interfaces.niftyreg.reg

RegAladin

Link to code

Wraps the executable command reg_aladin.

Interface for executable reg_aladin from NiftyReg platform.

Block Matching algorithm for symmetric global registration. Based on Modat et al., “Global image registration using asymmetric block-matching approach” J. Med. Img. 1(2) 024003, 2014, doi: 10.1117/1.JMI.1.2.024003

Source code

Examples

>>> from nipype.interfaces import niftyreg
>>> node = niftyreg.RegAladin()
>>> node.inputs.ref_file = 'im1.nii'
>>> node.inputs.flo_file = 'im2.nii'
>>> node.inputs.rmask_file = 'mask.nii'
>>> node.inputs.omp_core_val = 4
>>> node.cmdline
'reg_aladin -aff im2_aff.txt -flo im2.nii -omp 4 -ref im1.nii -res im2_res.nii.gz -rmask mask.nii'

Inputs:

[Mandatory]
ref_file: (an existing file name)
        The input reference/target image
        argument: ``-ref %s``
flo_file: (an existing file name)
        The input floating/source image
        argument: ``-flo %s``

[Optional]
nosym_flag: (a boolean)
        Turn off symmetric registration
        argument: ``-noSym``
rig_only_flag: (a boolean)
        Do only a rigid registration
        argument: ``-rigOnly``
aff_direct_flag: (a boolean)
        Directly optimise the affine parameters
        argument: ``-affDirect``
in_aff_file: (an existing file name)
        The input affine transformation
        argument: ``-inaff %s``
rmask_file: (an existing file name)
        The input reference mask
        argument: ``-rmask %s``
fmask_file: (an existing file name)
        The input floating mask
        argument: ``-fmask %s``
maxit_val: (a long integer >= 0)
        Maximum number of iterations
        argument: ``-maxit %d``
ln_val: (a long integer >= 0)
        Number of resolution levels to create
        argument: ``-ln %d``
lp_val: (a long integer >= 0)
        Number of resolution levels to perform
        argument: ``-lp %d``
smoo_r_val: (a float)
        Amount of smoothing to apply to reference image
        argument: ``-smooR %f``
smoo_f_val: (a float)
        Amount of smoothing to apply to floating image
        argument: ``-smooF %f``
nac_flag: (a boolean)
        Use nifti header to initialise transformation
        argument: ``-nac``
cog_flag: (a boolean)
        Use the masks centre of mass to initialise the transformation
        argument: ``-cog``
v_val: (a long integer >= 0)
        Percent of blocks that are active
        argument: ``-pv %d``
i_val: (a long integer >= 0)
        Percent of inlier blocks
        argument: ``-pi %d``
ref_low_val: (a float)
        Lower threshold value on reference image
        argument: ``-refLowThr %f``
ref_up_val: (a float)
        Upper threshold value on reference image
        argument: ``-refUpThr %f``
flo_low_val: (a float)
        Lower threshold value on floating image
        argument: ``-floLowThr %f``
flo_up_val: (a float)
        Upper threshold value on floating image
        argument: ``-floUpThr %f``
platform_val: (an integer (int or long))
        Platform index
        argument: ``-platf %i``
gpuid_val: (an integer (int or long))
        Device to use id
        argument: ``-gpuid %i``
verbosity_off_flag: (a boolean)
        Turn off verbose output
        argument: ``-voff``
aff_file: (a file name)
        The output affine matrix file
        argument: ``-aff %s``
res_file: (a file name)
        The affine transformed floating image
        argument: ``-res %s``
omp_core_val: (an integer (int or long), nipype default value: 1)
        Number of openmp thread to use
        argument: ``-omp %i``
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

aff_file: (a file name)
        The output affine file
res_file: (a file name)
        The output transformed image
avg_output: (a string)
        Output string in the format for reg_average

RegF3D

Link to code

Wraps the executable command reg_f3d.

Interface for executable reg_f3d from NiftyReg platform.

Fast Free-Form Deformation (F3D) algorithm for non-rigid registration. Initially based on Modat et al., “Fast Free-Form Deformation using graphics processing units”, CMPB, 2010

Source code

Examples

>>> from nipype.interfaces import niftyreg
>>> node = niftyreg.RegF3D()
>>> node.inputs.ref_file = 'im1.nii'
>>> node.inputs.flo_file = 'im2.nii'
>>> node.inputs.rmask_file = 'mask.nii'
>>> node.inputs.omp_core_val = 4
>>> node.cmdline
'reg_f3d -cpp im2_cpp.nii.gz -flo im2.nii -omp 4 -ref im1.nii -res im2_res.nii.gz -rmask mask.nii'

Inputs:

[Mandatory]
ref_file: (an existing file name)
        The input reference/target image
        argument: ``-ref %s``
flo_file: (an existing file name)
        The input floating/source image
        argument: ``-flo %s``

[Optional]
aff_file: (an existing file name)
        The input affine transformation file
        argument: ``-aff %s``
incpp_file: (an existing file name)
        The input cpp transformation file
        argument: ``-incpp %s``
rmask_file: (an existing file name)
        Reference image mask
        argument: ``-rmask %s``
ref_smooth_val: (a float)
        Smoothing kernel width for reference image
        argument: ``-smooR %f``
flo_smooth_val: (a float)
        Smoothing kernel width for floating image
        argument: ``-smooF %f``
rlwth_thr_val: (a float)
        Lower threshold for reference image
        argument: ``--rLwTh %f``
rupth_thr_val: (a float)
        Upper threshold for reference image
        argument: ``--rUpTh %f``
flwth_thr_val: (a float)
        Lower threshold for floating image
        argument: ``--fLwTh %f``
fupth_thr_val: (a float)
        Upper threshold for floating image
        argument: ``--fUpTh %f``
rlwth2_thr_val: (a tuple of the form: (a long integer >= 0, a float))
        Lower threshold for reference image at the specified time point
        argument: ``-rLwTh %d %f``
rupth2_thr_val: (a tuple of the form: (a long integer >= 0, a float))
        Upper threshold for reference image at the specified time point
        argument: ``-rUpTh %d %f``
flwth2_thr_val: (a tuple of the form: (a long integer >= 0, a float))
        Lower threshold for floating image at the specified time point
        argument: ``-fLwTh %d %f``
fupth2_thr_val: (a tuple of the form: (a long integer >= 0, a float))
        Upper threshold for floating image at the specified time point
        argument: ``-fUpTh %d %f``
sx_val: (a float)
        Final grid spacing along the x axes
        argument: ``-sx %f``
sy_val: (a float)
        Final grid spacing along the y axes
        argument: ``-sy %f``
sz_val: (a float)
        Final grid spacing along the z axes
        argument: ``-sz %f``
be_val: (a float)
        Bending energy value
        argument: ``-be %f``
le_val: (a float)
        Linear elasticity penalty term
        argument: ``-le %f``
jl_val: (a float)
        Log of jacobian of deformation penalty value
        argument: ``-jl %f``
no_app_jl_flag: (a boolean)
        Do not approximate the log of jacobian penalty at control points
        only
        argument: ``-noAppJL``
nmi_flag: (a boolean)
        use NMI even when other options are specified
        argument: ``--nmi``
rbn_val: (a long integer >= 0)
        Number of bins in the histogram for reference image
        argument: ``--rbn %d``
fbn_val: (a long integer >= 0)
        Number of bins in the histogram for reference image
        argument: ``--fbn %d``
rbn2_val: (a tuple of the form: (a long integer >= 0, a long integer
          >= 0))
        Number of bins in the histogram for reference image for given time
        point
        argument: ``-rbn %d %d``
fbn2_val: (a tuple of the form: (a long integer >= 0, a long integer
          >= 0))
        Number of bins in the histogram for reference image for given time
        point
        argument: ``-fbn %d %d``
lncc_val: (a float)
        SD of the Gaussian for computing LNCC
        argument: ``--lncc %f``
lncc2_val: (a tuple of the form: (a long integer >= 0, a float))
        SD of the Gaussian for computing LNCC for a given time point
        argument: ``-lncc %d %f``
ssd_flag: (a boolean)
        Use SSD as the similarity measure
        argument: ``--ssd``
ssd2_flag: (a long integer >= 0)
        Use SSD as the similarity measure for a given time point
        argument: ``-ssd %d``
kld_flag: (a boolean)
        Use KL divergence as the similarity measure
        argument: ``--kld``
kld2_flag: (a long integer >= 0)
        Use KL divergence as the similarity measure for a given time point
        argument: ``-kld %d``
amc_flag: (a boolean)
        Use additive NMI
        argument: ``-amc``
nox_flag: (a boolean)
        Don't optimise in x direction
        argument: ``-nox``
noy_flag: (a boolean)
        Don't optimise in y direction
        argument: ``-noy``
noz_flag: (a boolean)
        Don't optimise in z direction
        argument: ``-noz``
maxit_val: (a long integer >= 0)
        Maximum number of iterations per level
        argument: ``-maxit %d``
ln_val: (a long integer >= 0)
        Number of resolution levels to create
        argument: ``-ln %d``
lp_val: (a long integer >= 0)
        Number of resolution levels to perform
        argument: ``-lp %d``
nopy_flag: (a boolean)
        Do not use the multiresolution approach
        argument: ``-nopy``
noconj_flag: (a boolean)
        Use simple GD optimization
        argument: ``-noConj``
pert_val: (a long integer >= 0)
        Add perturbation steps after each optimization step
        argument: ``-pert %d``
vel_flag: (a boolean)
        Use velocity field integration
        argument: ``-vel``
fmask_file: (an existing file name)
        Floating image mask
        argument: ``-fmask %s``
smooth_grad_val: (a float)
        Kernel width for smoothing the metric gradient
        argument: ``-smoothGrad %f``
pad_val: (a float)
        Padding value
        argument: ``-pad %f``
verbosity_off_flag: (a boolean)
        Turn off verbose output
        argument: ``-voff``
cpp_file: (a file name)
        The output CPP file
        argument: ``-cpp %s``
res_file: (a file name)
        The output resampled image
        argument: ``-res %s``
omp_core_val: (an integer (int or long), nipype default value: 1)
        Number of openmp thread to use
        argument: ``-omp %i``
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

cpp_file: (a file name)
        The output CPP file
res_file: (a file name)
        The output resampled image
invcpp_file: (a file name)
        The output inverse CPP file
invres_file: (a file name)
        The output inverse res file
avg_output: (a string)
        Output string in the format for reg_average