How to use .img format files ?

조회 수: 27 (최근 30일)
Anum
Anum 2014년 4월 9일
댓글: Walter Roberson 2014년 4월 9일
How can we use .img format files (images ) in MATLAB code, or is there anyway to convert these files(images) into .jpg format ?
  댓글 수: 1
Anum
Anum 2014년 4월 9일
I have tried analyze75read command, but getting errors, may be because i dont have .hdr file. But basically this is the medical image dataset which I downloaded from an authentic site and there is no .hdr file avalaible even I saw on some other sites, but everywhere medical images are stored in .img format so there must be some way to use it. Below is the link of my .img file. http://1drv.ms/PQdIox I will be thankful If anyone can help me out.

댓글을 달려면 로그인하십시오.

답변 (2개)

Dishant Arora
Dishant Arora 2014년 4월 9일
fid = fopen('fileName.img');
data = fread(fid, dataDimensions, precision)
close(fid)
for more info:
doc fread
doc fopen
And use imwrite to save it as jpeg.

Walter Roberson
Walter Roberson 2014년 4월 9일
.img files are not image files that are handled by imread(), and they are also not just plain binary files as hinted by Dishant.
.img files can be DICOM files; for those see dicomread()
  댓글 수: 1
Walter Roberson
Walter Roberson 2014년 4월 9일
Perhaps you could use dcm_unconvert to recreate the dcm file that could be read with dicomread()

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by