fslroi code example

Example: fslroi

# Use fslroi to extract a specific volume from a 4D image. 

# The 1st numerical argument is the volume upon which to begin extraction. 
# Indexing starts with 0 not 1. 
# The 2nd numerical argument is the size (# volumes) to extract. 
# A size of -1 will retrieve the full image extent for that dimension. 
# The first file is input, the second file is output. 
# The following example takes img_fmri and retains the first 128 volumes 
# in the same file name.

fslroi img_fmri img_fmri 0 128