找到你要的答案

Q:Resampling fmri images using R

Q:使用R重采样功能磁共振成像图像

I would like to resample a fmri image (nii or.img) with dimensions 53x63x46 to an new image with 256x256x256.

In fact, I just need the new 3D array (matrix).

In R would be:

NEWIMAGE [1:256,1:256,1:256]

If is not possible, do you know how SPM (matlab)does it? If possible, the code.

Source image files, example:

IMG Dimension (53x63x46) : https://www.dropbox.com/s/25oa0wr7prbcbl7/fica_3.img?dl=0

HDR: https://www.dropbox.com/s/4quyx60wraiw2o4/fica_3.hdr?dl=0

Result using SPM:

New IMG Dimension (256x256x256): https://www.dropbox.com/s/y4ut9ttrj964q8c/ica3.nii?dl=0

Thanks!

我想一个fMRI图像重采样(NII或img)的尺寸53x63x46 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:

新的图片尺寸(256x256x256):https://www.dropbox.com/s/y4ut9ttrj964q8c/ica3.nii?DL = 0

谢谢!

answer1: 回答1:

I couldn't find a way to do it using R specifically, but I will present two ways to do it:

1 - Using 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 - Using FSL:

flirt -in image_to_resample.img -ref ref_image.img -out new_image.img -applyisoxfm 1

Also you can use SPM, "Coregister (Reslice)".

Hope it helps!

我找不到一个方法,特别是使用R,但我将介绍两种方法来做它:

1 - Using 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(切割)”。

希望它帮助!

r  image  matlab  resampling