how to open the image extension .dat
24 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi all,
I was Download the Zubal phantom from this site: http://noodle.med.yale.edu/phantom/getzubdata.htm
I attached the file.
But anyone can help me how to open it as CT view images? Because I know the files is CT image phantom.
1 commentaire
DGM
le 11 Fév 2022
I can't log into that site. Do you know what the image geometry is supposed to be?
It's readable, but without the header file or any other info, it's just guesswork to rectify it.
Réponse acceptée
DGM
le 11 Fév 2022
Modifié(e) : DGM
le 11 Fév 2022
Knowing the image geometry is 90% of the battle. Imrectify() can do a good job of figuring it out, but I never wrote it to handle multipage images. Realistically, expanding the problem of guesswork into 3D really obliterates the constraints that make the task able to be simplified as such.
I don't have an answer, but here is some insight. I'm just going to rename the file so it can be uploaded here.
fid = fopen('voxel_man.dat.txt','r');
A = fread(fid,Inf,'*uint16'); % i'm assuming it's uint16
fclose(fid);
% find valid page counts
np = 1:25; % let's assume this has a pagecount in this range
ppix = numel(A)./np;
isgood = mod(ppix,1)==0;
ppix = ppix(isgood);
np = np(isgood);
fprintf('%d\t%d\n',[np; ppix]) % these are the valid pagecounts and pagelengths
% dump high-AR candidate geometries for each page count
% this assumes that any practical page size has a normalized aspect ratio >= 1/4
for pp = 1:numel(np)
P = pairfactor(ppix(pp),false);
Phar = P(P(:,1)./P(:,2) >= 0.25,:);
[Phar repmat(np(pp),size(Phar,1),1)]
end
I would assume that the pages would be relatively small and relatively square; maybe 512x512 or something simple. After trying a dozen different geometries, I'm not sure.
This should at least serve as a demonstration for how to find candidate geometries.
EDIT:
Here. Try this.
fid = fopen('voxel_man.dat.txt','r');
A = fread(fid,Inf,'*uint16'); % i'm assuming it's uint16
fclose(fid);
B = reshape(A,64,128,[]); % there's your image
imshow(B(:,:,100),[])
I didn't expect the page size to be so small. Assuming a low page count was leaving me soundly in the realm of pixel salads.
2 commentaires
yanqi liu
le 11 Fév 2022
yes,sir,may be check the data size
fid = fopen('voxel_man.dat','rb');
t = fread(fid, 'float');
fclose(fid);
length(t)/512
fid = fopen('voxel_man.dat','rb');
t = fread(fid, 'uint8');
fclose(fid);
length(t)/512
Plus de réponses (1)
Benjamin Thompson
le 10 Fév 2022
Can your tool save to NII or NifTI format, then load it using niftiread in MATLAB?
5 commentaires
DGM
le 11 Fév 2022
You can create the header info and then use dicomwrite().
These tools might be sufficient, depending on your needs.
Though if nothing else, you can simply look at how it's doing the file configuration internally.
Voir également
Catégories
En savoir plus sur Convert Image Type dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!