Read img medical image without header in matlab

我们两清 提交于 2019-12-01 01:38:56

The lung x-rays of the JSRT database (www.jsrt.or.jp/jsrt-db/eng.php), have that format. I tested this code with them and it works:

fid = fopen('image.img','r','b');
oneSlice = fread(fid, [2048 2048], '*uint16','b');
img = mat2gray(oneSlice, [0,4096]);
fclose(fid);
JohnD
%%% Read image
    fid = fopen('image.img','r','b');
    oneSlice = fread(fid, [2048 2048], '*uint16','b');
    img = mat2gray(oneSlice, [0,4096]);
    fclose(fid);

%%%rotate image

    imgR = imrotate(img,270);

%%%horizontal flip image

    imgRF = flipdim(TestImgR ,2);  
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!