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.

采用基于频率簇(Cluster)的置换检验(Permutation)方法选取感兴趣频段

作者:北京师范大学 龙宇航,longyuhangwork@163.com代码来源(见本页底部):周思远 在使用wtc计算脑间神经同步后,我们需要在多个频率段、多个通道组合上对神经同步值进行统计检验,因此当进行频段选择时,面临多重比较的问题。为了解决多重比较的问题,可以采取基于参数或非参数检验的多重比较矫正的方法。由于基于非参数检验的多重比较矫正对数据的分布形态没有严格要求,因此具有更广泛的应用场景 (Maris and Oostenveld, 2007)。本文即介绍基于随机置换的非参数检验的方法 (Zheng et al., 2020; Long et al., 2021)。 在寻找感兴趣的效应时,我们采取了基于频率簇(Cluster)的方法,即在频率方向寻找连续显著的Cluster,该方法比基于最强效应点的方法具有更为优秀的抗噪音能力。值得注意的是,我们并没有沿着通道的方向去寻找连续显著的通道簇,这是因为沿着通道方向寻找Cluster容易受到生理噪音的影响。 下面进入具体的实操部分。假设本例招募了22对组1被试及22对组2被试,每对被试分别进行3种条件的任务,因此本例是2(组别,被试间因素)*3(条件,被试内因素)的实验设计。本例对神经同步值进行2*3的混合方差分析,并关注交互作用。 具体来讲,进行置换检验需要进行以下几个步骤:1. 重采样;2. 对随机样本进行计算及统计;3. 计算真实样本的统计量;4. 真实样本与随机样本的对比。下面依次进行介绍。 1. 重采样...
Xu Cui
1 min read

第二十期 fNIRS Journal Club 通知 2021/06/26,10:00am

同时用fNIRS和EEG测量脑信号有哪些好处?技术上应该注意什么?美国斯坦福大学李日辉博士,将为大家讲解他做过的一个同时用fNIRS和EEG测量的实验。热烈欢迎大家参与讨论。 时间: 北京时间2021年6月26日上午10:00地点: https://zoom.com房间号: 856 9352 0230密码: 695930 李博士要讲解的文章如下: Li, Li, Roh, Wang, Zhang (2020) Multimodal Neuroimaging Using Concurrent EEG/fNIRS for Poststroke Recovery Assessment:...
Xu Cui
7 sec read

Calculate phase difference between two general signals (e.g. HbO…

In a recent fNIRS journal club (vedio recorded here), Dr. Tong talked about their work on the phase difference between oxy and deoxy Hb,...
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 to hi Cancel reply

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

Loading