Code

Splitting an ROI label in two:

(e.g., in this example, splitting anterior and posterior hippocampus at Y=-21; MNI space)

#take whole ROI and save only the anterior portion; do for left and right
3dcalc -a l_hipp.nii.gz -expr ‘step(a)step(isnegative(y+-21))’ -prefix ant_l_hipp.nii.gz
3dcalc -a r_hipp.nii.gz -expr ‘step(a)
step(isnegative(y+-21))’ -prefix ant_r_hipp.nii.gz

#take whole ROI and save only the posterior portion; do for left and right
3dcalc -a l_hipp.nii.gz -expr ‘step(a)step(y+-21)’ -prefix post_l_hipp.nii.gz
3dcalc -a r_hipp.nii.gz -expr ‘step(a)
step(y+-21)’ -prefix post_r_hipp.nii.gz

#check in FSLview to make sure split was done correctly; anterior ROIs color code in blue shades, posterior ROIs color code in red shades; overlay on the standard for the Ss
fslview standard.nii.gz ant_l_hipp.nii.gz -l “Blue” ant_r_hipp.nii.gz -l “Red” post_l_hipp.nii.gz -l “Blue-Lightblue” post_r_hipp.nii.gz -l “Cool”