brain images: convert between different formats

1 min read

For single file to single file conversion, you usually use mri_convert of freesurfer. For example
mri_convert x.img y.nii

Other options would be LONI Debabeler or MRICro.

Here are some special cases:
multiple 3D ANALYZE to a single 4D Nifti: mri_concat
mri_concat is a program of freesurfer. Assume the original image files are f001.img, f002.img … etc. The output file is f.nii.

mri_concat f???.img --o f.nii

You can also use FSL’s fslmerge to achieve the same thing (but pay attention to your fsl environment setting for default output format).
multiple DICOM to other format
To convert DICOM files to other format, use mri_convert

mri_convert I0001.dcm  T1.mgz

If you have a bunch of DICOM files (slices) for a single brain, you only need to input the 1st one as the argument of mri_convert.

Another way is to use SPM’s DICOM import. In the end you get ANALYZE files.
GE 7 file to ANALYZE or Nifti: makevols and makenifti
.7 files are functional images produced by GE scanners in Stanford. You use makevols to convert.

makevols E*P*.7 I
rename I.V I_ I.V*

You will get a bunch of .img/.hdr files.
To make a Nifti file, you run

makenifti Efilename outfilename

The output is a single nii file (outfilename.nii).

Note: If you rename the .7 files, you might not get makevols to work. For example, if you rename P06144.7 to P06144_mer1.7, makevols doesn’t work (only produces a lot .hdr files but not .img files).

makevols and makenifti are written by Dr. Gary Glover at Stanford University. Here you can download the two programs.

Check out here to see how to convert images with different number of bytes per voxel.

第十二期 fNIRS Journal Club 视频

在2020/9/26日, 华东师范大学李先春教授和他的学生陈美为大家讲解他们今年发表的一篇用近红外超扫描揭示欺骗行为神经机制的文章。视频如下: Youtube:https://www.youtube.com/watch?v=Qyn1vqUetiQYouku:https://v.youku.com/v_show/id_XNDg3ODkxOTA0MA==.html
Xu Cui
6 sec read

第十三期 fNIRS Journal Club 通知 2020/10/24,10am

北京时间2020年10月24日周六上午10点, 华东师范大学青少年健康评价与运动干预教育部重点实验室、华东师范大学体育与健康学院李琳教授将为大家讲解她们今年发表的一篇用近红外超扫描揭示团体体育运动(篮球)增强合作行为的文章。欢迎大家参加并参与讨论。 时间: 北京时间2020年10月24日周六上午10点地点: https://zoom.com房间号: 865 4354 8112密码: 497127 她要讲解的文献如下: Li, Wang, Luo, Zhang, Zhang, Li (2020) Interpersonal Neural Synchronization During Cooperative Behavior of...
Xu Cui
43 sec read

第十二期 fNIRS Journal Club 通知 2020/9/26,10am

北京时间2020年9月26日周六上午10点, 华东师范大学李先春教授将为大家讲解他们刚刚发表在 Human brain mapping 的一篇用近红外超扫描揭示欺骗行为的男女差别的文章。欢迎大家参加并参与讨论。 时间: 北京时间2020年9月26日周六上午10点地点: https://zoom.com房间号: 841 2136 8036密码: 603763 他要讲解的文献如下: Chen, Zhang, Zhang, Wang, Yin, Li, Liu, Liu, Li (2020)...
Xu Cui
1 min read

2 Replies to “brain images: convert between different formats”

  1. Hi Professor,

    Is it possible to convert/merge multiple 3D Analyze files into a single 4D NIFTI using R?

    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *