how to open the image extension .dat

28 ビュー (過去 30 日間)
mohd akmal masud
mohd akmal masud 2022 年 2 月 10 日
コメント済み: DGM 2022 年 2 月 11 日
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 件のコメント
DGM
DGM 2022 年 2 月 11 日
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.

サインインしてコメントする。

採用された回答

DGM
DGM 2022 年 2 月 11 日
編集済み: DGM 2022 年 2 月 11 日
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
1 1990656 2 995328 3 663552 4 497664 6 331776 8 248832 9 221184 12 165888 16 124416 18 110592 24 82944
% 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
ans = 6×3
768 2592 1 864 2304 1 972 2048 1 1024 1944 1 1152 1728 1 1296 1536 1
ans = 6×3
512 1944 2 576 1728 2 648 1536 2 768 1296 2 864 1152 2 972 1024 2
ans = 5×3
432 1536 3 512 1296 3 576 1152 3 648 1024 3 768 864 3
ans = 6×3
384 1296 4 432 1152 4 486 1024 4 512 972 4 576 864 4 648 768 4
ans = 6×3
288 1152 6 324 1024 6 384 864 6 432 768 6 512 648 6 576 576 6
ans = 6×3
256 972 8 288 864 8 324 768 8 384 648 8 432 576 8 486 512 8
ans = 4×3
256 864 9 288 768 9 384 576 9 432 512 9
ans = 5×3
216 768 12 256 648 12 288 576 12 324 512 12 384 432 12
ans = 6×3
192 648 16 216 576 16 243 512 16 256 486 16 288 432 16 324 384 16
ans = 4×3
192 576 18 216 512 18 256 432 18 288 384 18
ans = 6×3
144 576 24 162 512 24 192 432 24 216 384 24 256 324 24 288 288 24
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 件のコメント
yanqi liu
yanqi liu 2022 年 2 月 11 日
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
DGM
DGM 2022 年 2 月 11 日
Yes, I just demonstrated the factorization of the vector length.

サインインしてコメントする。

その他の回答 (1 件)

Benjamin Thompson
Benjamin Thompson 2022 年 2 月 10 日
Can your tool save to NII or NifTI format, then load it using niftiread in MATLAB?
  5 件のコメント
mohd akmal masud
mohd akmal masud 2022 年 2 月 11 日
I see.. then is it possible to convert into dicom format?
DGM
DGM 2022 年 2 月 11 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by