Niftyreg Groupwise

From CMIC
Jump to: navigation, search

The NiftyReg install bin folder contains two shell scripts that can be used to create a groupwise average space:

groupwise_niftyreg_run.sh and groupwise_niftyreg_params.sh

The first script, groupwise_niftyreg_run.sh, should not be edited as it contains the actual pipeline. The second, groupwise_niftyreg_params.sh, should be edited by the user to specify the groupwise parameters.

The content of the parameters script is as follow:

#!/bin/sh

############################################################################
###################### PARAMETERS THAT CAN BE CHANGED ######################
############################################################################
# Array that contains the input images to create the atlas
export IMG_INPUT=(`ls /path/to/all/your/images_*.nii`)
export IMG_INPUT_MASK= # leave empty to not use floating masks

# template image to use to initialise the atlas creation
export TEMPLATE=`ls ${IMG_INPUT[0]}` 
 export TEMPLATE_MASK= # leave empty to not use a reference mask

# folder where the result images will be saved
export RES_FOLDER="/path/to/a/folder/to/store/all/result" 

# argument to use for the affine (reg_aladin)
export AFFINE_args=""
# argument to use for the non-rigid registration (reg_f3d)
export NRR_args=""

# number of affine loop to perform
export AFF_IT_NUM=10

# number of non-rigid loop to perform
export NRR_IT_NUM=10

# grid engine arguments
export QSUB_CMD="qsub -l h_rt=05:00:00 -l tmem=3.5G -l h_vmem=3.5G -l vf=3.5G -l s_stack=10240  -j y -S /bin/csh -b y -cwd -V"
############################################################################

where:

  • The IMG_INPUT variable is a list containing all the images to be used for the groupwise
  • The IMG_INPUT_MASK variable is containing all the corresponding masks. If empty, no mask is used. Note that the masks are only used with the symmetric versions of the registration (reg_aladin and reg_f3d)
  • The TEMPLATE variable contains the template image to use to define the groupwise discretisation space.
  • The TEMPLATE_MASK variable contains the mask associated with the TEMPLATE image. If empty, no mask is used.
  • The RES_FOLDER variable is a path where all the results will be saved.
  • The AFFINE_args variable contains the non default parameters to be used by the rigid and affine executable reg_aladin (see reg_aladin -help)
  • The NRR_args variable contains the non default parameters to be used by the non-linear executable reg_f3d (see reg_f3d -help)
  • The AFF_IT_NUM variable contains the number of rigid / affine steps to perform. Note that the first step is always rigid to avoid creating bias toward the initial template image.
  • The NRR_IT_NUM variable contains the number of non-linear steps to perform.
  • If a Sun Grid Engine is used, the QSUB_CMD variable contains the job submission parameters.

Once the groupwise_niftyreg_params.sh file has been edited and renamed to groupwise_params_example.sh, the following command will be use to run the groupwise registration:

  • sh groupwise_niftyreg_run.sh groupwise_params_example.sh