フィルターのクリア

How to convert Dicom images (.dcm) into '.img' format ?

9 ビュー (過去 30 日間)
Gopichandh Danala
Gopichandh Danala 2017 年 6 月 9 日
コメント済み: Walter Roberson 2017 年 6 月 13 日
Hi, I have a c ++ program linked through MEX file to a Matlab program. The input to this is only '.img' format. Now I have a few images which are .dcm which cannot be given as input to the program.
Is there any way to convert .dcm to .img format?

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 6 月 10 日
You can use dicomread() to read the files.
If you look in the File Exchange you will find several programs that can write ENVI img/hdr files
  5 件のコメント
Gopichandh Danala
Gopichandh Danala 2017 年 6 月 13 日
Walter, Can you help me with using this files. I found a function by name: save_nii inside the zip file at https://www.mathworks.com/matlabcentral/fileexchange/8797-tools-for-nifti-and-analyze-image.
The function says: Support both .nii and *.hdr/.img file extension
Usage: save_nii(nii, filename, [old_RGB])
I tried to enter
save_nii(img,'savedImage.img',0)
where img is image read using dicomread, and the last argument is [RGB], as the image is grayscale I entered '0'. But it gives the error:
Error using save_nii (line 56)
Usage: save_nii(nii, filename, [old_RGB])
can you please try this
Walter Roberson
Walter Roberson 2017 年 6 月 13 日
Look at the documentation:
% Usage: save_nii(nii, filename, [old_RGB])
%
% nii.hdr - struct with NIFTI header fields (from load_nii.m or make_nii.m)
%
% nii.img - 3D (or 4D) matrix of NIFTI data.
You passed in a plain data array instead of an appropriate struct.

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

カテゴリ

Help Center および File ExchangeImport, Export, and Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by