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 通知 2021/08/28,10:00am

美国南卡罗来纳大学心理学系的符晓雪博士,将为大家讲解她刚刚发表在Neurophotonics上的一篇文章,用NIRS研究发育过程中头皮和大脑关系的变化。热烈欢迎大家参与讨论。 时间: 北京时间2021年8月28日上午10:00地点: https://zoom.com房间号: 845 7541 3964密码: 829803 符晓雪博士是南卡罗来纳大学心理学系的博士后研究员。 她在宾夕法尼亚州立大学获得发育心理学博士学位。 她的博士后工作重点是 fNIRS 和 ERP 的皮层源定位方法。 符博士要讲解的文章如下: Fu, Richards (2021) Investigating developmental changes in scalp-to-cortex...
Xu Cui
6 sec read

第二十一期 fNIRS Journal Club 视频

北京时间2021年7月31日11:00,华东师范大学心理与认知科学学院卢克龙博士,为大家讲解了他去年发表在NeuroImage上的一篇文章,利用行为实验方法及fNIRS等技术手段,探讨个体和团体创造活动的影响因素、动态过程,及背后的认知神经基础。 Lu K, Yu T, Hao N. Creating while taking turns, the choice to unlocking group creative potential. Neuroimage. 2020 Oct 1;219:117025. https://storkapp.me/pubpaper/32512127 Youtube:...
Xu Cui
11 sec read

The Dolphin Game: Tips and Tricks for Hyperscanning with…

Note: The following article is a guest post by Vanessa Reindl from University Hospital RWTH Aachen, Germany. She made our original hyperscanning game more...
Xu Cui
2 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 *