使用 R 重新采样 fmri 图像
Resampling fmri images using R
我想将尺寸为 53x63x46 的 fmri 图像 (nii or.img) 重新采样为尺寸为 256x256x256 的新图像。
其实我只需要新的3D数组(矩阵)。
在 R 中是:
NEWIMAGE [1:256,1:256,1:256]
如果做不到,你知道SPM(matlab)是怎么做到的吗?如果可能的话,代码。
源图像文件,示例:
IMG 尺寸 (53x63x46):https://www.dropbox.com/s/25oa0wr7prbcbl7/fica_3.img?dl=0
HDR:https://www.dropbox.com/s/4quyx60wraiw2o4/fica_3.hdr?dl=0
使用 SPM 的结果:
新 IMG 尺寸 (256x256x256):https://www.dropbox.com/s/y4ut9ttrj964q8c/ica3.nii?dl=0
谢谢!
我找不到专门使用 R 的方法,但我将介绍两种方法:
1 - 使用 Fresurfer:
#!/bin/bash
export FREESURFER_HOME=~/Neuro/freesurfer # your folder...
source $FREESURFER_HOME/SetUpFreeSurfer.sh
mri_convert -rl reference_image.img -rt interpolate image_to_resample.img new_image.img
2 - 使用 FSL:
flirt -in image_to_resample.img -ref ref_image.img -out new_image.img -applyisoxfm 1
您也可以使用 SPM,"Coregister (Reslice)"。
希望对您有所帮助!
我想将尺寸为 53x63x46 的 fmri 图像 (nii or.img) 重新采样为尺寸为 256x256x256 的新图像。
其实我只需要新的3D数组(矩阵)。
在 R 中是:
NEWIMAGE [1:256,1:256,1:256]
如果做不到,你知道SPM(matlab)是怎么做到的吗?如果可能的话,代码。
源图像文件,示例:
IMG 尺寸 (53x63x46):https://www.dropbox.com/s/25oa0wr7prbcbl7/fica_3.img?dl=0
HDR:https://www.dropbox.com/s/4quyx60wraiw2o4/fica_3.hdr?dl=0
使用 SPM 的结果:
新 IMG 尺寸 (256x256x256):https://www.dropbox.com/s/y4ut9ttrj964q8c/ica3.nii?dl=0
谢谢!
我找不到专门使用 R 的方法,但我将介绍两种方法:
1 - 使用 Fresurfer:
#!/bin/bash
export FREESURFER_HOME=~/Neuro/freesurfer # your folder...
source $FREESURFER_HOME/SetUpFreeSurfer.sh
mri_convert -rl reference_image.img -rt interpolate image_to_resample.img new_image.img
2 - 使用 FSL:
flirt -in image_to_resample.img -ref ref_image.img -out new_image.img -applyisoxfm 1
您也可以使用 SPM,"Coregister (Reslice)"。
希望对您有所帮助!