Resample an Image to Specific Voxel Size
fsl_resample(
file,
voxel_size,
outfile = NULL,
retimg = TRUE,
reorient = FALSE,
opts = NULL,
verbose = TRUE
)Input file to resample
Voxel size (in mm). This should be a scalar number.
(character) output filename
(logical) return image of class nifti
(logical) If retimg, should file be reoriented when read in?
Passed to readnii.
options to pass to flirt
(logical) print out command before running
If retimg then object of class nifti. Otherwise,
the output file.
if (have_fsl()) {
file = mni_fname(mm = 1, brain = TRUE)
est2 = fsl_resample(file = file, voxel_size = 1, retimg = FALSE)
pixdim(est2)
est = fsl_resample(file = file, voxel_size = 1)
pixdim(est)
}
#> flirt -in "/usr/local/fsl/data/standard/MNI152_T1_1mm_brain.nii.gz" -ref /usr/local/fsl/data/standard/MNI152_T1_1mm_brain.nii.gz -applyisoxfm 1 -out "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpKzob0N/file85756130b58a";
#> flirt -in "/usr/local/fsl/data/standard/MNI152_T1_1mm_brain.nii.gz" -ref /usr/local/fsl/data/standard/MNI152_T1_1mm_brain.nii.gz -applyisoxfm 1 -out "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpKzob0N/file857544dea8df";
#> [1] -1 1 1 1 1 1 1 1