opening a .rec file
28 次查看(过去 30 天)
显示 更早的评论
I have a .rec file which is supposed to be a reconstructed SPECT image of a point source. I am trying to open it up in matlab.
I have usually used the following generic way of opening image data files in matlab:
fid = fopen('filename.ext','r');
A = fread(fid,sizeA,precision);
imagesc(A)
colormap('gray')
axis image off
but this block of code does not open my .rec file in this case. It simply returns a blank gray screen with no image. I was told something about specifying the file format, but I'm not sure how to do this.
5 个评论
回答(1 个)
Image Analyst
2014-8-27
Richard,
No, precision would be something like '*uint8'. What you called precision is actually "sizeA" and would be sizeA = [45, 45]. So try
sizeA = [45, 45];
precision = '*uint8';
A = fread(fid,sizeA,precision);
imshow(A, [])
colormap('gray');
axis on;
5 个评论
Image Analyst
2014-8-27
It may. Looks like you need the fig file also since it's a GUIDE file. Try reading in A as bytes, or just opening it in notepad. Is it all zeros if you use either of those? If so, then the file actually is all zeros for some reason.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!