nipype.interfaces.niftyreg.reg module

The reg module provides classes for interfacing with the niftyreg registration command line tools.

The interfaces were written to work with niftyreg version 1.5.10

class nipype.interfaces.niftyreg.reg.RegAladin(required_version=None, **inputs)

Bases: NiftyRegCommand

Wrapped executable: 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'

Mandatory Inputs

flo_filea pathlike object or string representing an existing file

The input floating/source image. Maps to a command-line argument: -flo %s.

ref_filea pathlike object or string representing an existing file

The input reference/target image. Maps to a command-line argument: -ref %s.

Optional Inputs

aff_direct_flaga boolean

Directly optimise the affine parameters. Maps to a command-line argument: -affDirect.

aff_filea pathlike object or string representing a file

The output affine matrix file. Maps to a command-line argument: -aff %s.

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

cog_flaga boolean

Use the masks centre of mass to initialise the transformation. Maps to a command-line argument: -cog.

environa 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’

Environment variables. (Nipype default value: {})

flo_low_vala float

Lower threshold value on floating image. Maps to a command-line argument: -floLowThr %f.

flo_up_vala float

Upper threshold value on floating image. Maps to a command-line argument: -floUpThr %f.

fmask_filea pathlike object or string representing an existing file

The input floating mask. Maps to a command-line argument: -fmask %s.

gpuid_valan integer

Device to use id. Maps to a command-line argument: -gpuid %i.

i_valan integer >= 0

Percent of inlier blocks. Maps to a command-line argument: -pi %d.

in_aff_filea pathlike object or string representing an existing file

The input affine transformation. Maps to a command-line argument: -inaff %s.

ln_valan integer >= 0

Number of resolution levels to create. Maps to a command-line argument: -ln %d.

lp_valan integer >= 0

Number of resolution levels to perform. Maps to a command-line argument: -lp %d.

maxit_valan integer >= 0

Maximum number of iterations. Maps to a command-line argument: -maxit %d.

nac_flaga boolean

Use nifti header to initialise transformation. Maps to a command-line argument: -nac.

nosym_flaga boolean

Turn off symmetric registration. Maps to a command-line argument: -noSym.

omp_core_valan integer

Number of openmp thread to use. Maps to a command-line argument: -omp %i. (Nipype default value: 1)

platform_valan integer

Platform index. Maps to a command-line argument: -platf %i.

ref_low_vala float

Lower threshold value on reference image. Maps to a command-line argument: -refLowThr %f.

ref_up_vala float

Upper threshold value on reference image. Maps to a command-line argument: -refUpThr %f.

res_filea pathlike object or string representing a file

The affine transformed floating image. Maps to a command-line argument: -res %s.

rig_only_flaga boolean

Do only a rigid registration. Maps to a command-line argument: -rigOnly.

rmask_filea pathlike object or string representing an existing file

The input reference mask. Maps to a command-line argument: -rmask %s.

smoo_f_vala float

Amount of smoothing to apply to floating image. Maps to a command-line argument: -smooF %f.

smoo_r_vala float

Amount of smoothing to apply to reference image. Maps to a command-line argument: -smooR %f.

v_valan integer >= 0

Percent of blocks that are active. Maps to a command-line argument: -pv %d.

verbosity_off_flaga boolean

Turn off verbose output. Maps to a command-line argument: -voff.

Outputs

aff_filea pathlike object or string representing a file

The output affine file.

avg_outputa string

Output string in the format for reg_average.

res_filea pathlike object or string representing a file

The output transformed image.

class nipype.interfaces.niftyreg.reg.RegF3D(required_version=None, **inputs)

Bases: NiftyRegCommand

Wrapped executable: 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'

Mandatory Inputs

flo_filea pathlike object or string representing an existing file

The input floating/source image. Maps to a command-line argument: -flo %s.

ref_filea pathlike object or string representing an existing file

The input reference/target image. Maps to a command-line argument: -ref %s.

Optional Inputs

aff_filea pathlike object or string representing an existing file

The input affine transformation file. Maps to a command-line argument: -aff %s.

amc_flaga boolean

Use additive NMI. Maps to a command-line argument: -amc.

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

be_vala float

Bending energy value. Maps to a command-line argument: -be %f.

cpp_filea pathlike object or string representing a file

The output CPP file. Maps to a command-line argument: -cpp %s.

environa 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’

Environment variables. (Nipype default value: {})

fbn2_vala tuple of the form: (an integer >= 0, an integer >= 0)

Number of bins in the histogram for reference image for given time point. Maps to a command-line argument: -fbn %d %d.

fbn_valan integer >= 0

Number of bins in the histogram for reference image. Maps to a command-line argument: --fbn %d.

flo_smooth_vala float

Smoothing kernel width for floating image. Maps to a command-line argument: -smooF %f.

flwth2_thr_vala tuple of the form: (an integer >= 0, a float)

Lower threshold for floating image at the specified time point. Maps to a command-line argument: -fLwTh %d %f.

flwth_thr_vala float

Lower threshold for floating image. Maps to a command-line argument: --fLwTh %f.

fmask_filea pathlike object or string representing an existing file

Floating image mask. Maps to a command-line argument: -fmask %s.

fupth2_thr_vala tuple of the form: (an integer >= 0, a float)

Upper threshold for floating image at the specified time point. Maps to a command-line argument: -fUpTh %d %f.

fupth_thr_vala float

Upper threshold for floating image. Maps to a command-line argument: --fUpTh %f.

incpp_filea pathlike object or string representing an existing file

The input cpp transformation file. Maps to a command-line argument: -incpp %s.

jl_vala float

Log of jacobian of deformation penalty value. Maps to a command-line argument: -jl %f.

kld2_flagan integer >= 0

Use KL divergence as the similarity measure for a given time point. Maps to a command-line argument: -kld %d.

kld_flaga boolean

Use KL divergence as the similarity measure. Maps to a command-line argument: --kld.

le_vala float

Linear elasticity penalty term. Maps to a command-line argument: -le %f.

ln_valan integer >= 0

Number of resolution levels to create. Maps to a command-line argument: -ln %d.

lncc2_vala tuple of the form: (an integer >= 0, a float)

SD of the Gaussian for computing LNCC for a given time point. Maps to a command-line argument: -lncc %d %f.

lncc_vala float

SD of the Gaussian for computing LNCC. Maps to a command-line argument: --lncc %f.

lp_valan integer >= 0

Number of resolution levels to perform. Maps to a command-line argument: -lp %d.

maxit_valan integer >= 0

Maximum number of iterations per level. Maps to a command-line argument: -maxit %d.

nmi_flaga boolean

Use NMI even when other options are specified. Maps to a command-line argument: --nmi.

no_app_jl_flaga boolean

Do not approximate the log of jacobian penalty at control points only. Maps to a command-line argument: -noAppJL.

noconj_flaga boolean

Use simple GD optimization. Maps to a command-line argument: -noConj.

nopy_flaga boolean

Do not use the multiresolution approach. Maps to a command-line argument: -nopy.

nox_flaga boolean

Don’t optimise in x direction. Maps to a command-line argument: -nox.

noy_flaga boolean

Don’t optimise in y direction. Maps to a command-line argument: -noy.

noz_flaga boolean

Don’t optimise in z direction. Maps to a command-line argument: -noz.

omp_core_valan integer

Number of openmp thread to use. Maps to a command-line argument: -omp %i. (Nipype default value: 1)

pad_vala float

Padding value. Maps to a command-line argument: -pad %f.

pert_valan integer >= 0

Add perturbation steps after each optimization step. Maps to a command-line argument: -pert %d.

rbn2_vala tuple of the form: (an integer >= 0, an integer >= 0)

Number of bins in the histogram for reference image for given time point. Maps to a command-line argument: -rbn %d %d.

rbn_valan integer >= 0

Number of bins in the histogram for reference image. Maps to a command-line argument: --rbn %d.

ref_smooth_vala float

Smoothing kernel width for reference image. Maps to a command-line argument: -smooR %f.

res_filea pathlike object or string representing a file

The output resampled image. Maps to a command-line argument: -res %s.

rlwth2_thr_vala tuple of the form: (an integer >= 0, a float)

Lower threshold for reference image at the specified time point. Maps to a command-line argument: -rLwTh %d %f.

rlwth_thr_vala float

Lower threshold for reference image. Maps to a command-line argument: --rLwTh %f.

rmask_filea pathlike object or string representing an existing file

Reference image mask. Maps to a command-line argument: -rmask %s.

rupth2_thr_vala tuple of the form: (an integer >= 0, a float)

Upper threshold for reference image at the specified time point. Maps to a command-line argument: -rUpTh %d %f.

rupth_thr_vala float

Upper threshold for reference image. Maps to a command-line argument: --rUpTh %f.

smooth_grad_vala float

Kernel width for smoothing the metric gradient. Maps to a command-line argument: -smoothGrad %f.

ssd2_flagan integer >= 0

Use SSD as the similarity measure for a given time point. Maps to a command-line argument: -ssd %d.

ssd_flaga boolean

Use SSD as the similarity measure. Maps to a command-line argument: --ssd.

sx_vala float

Final grid spacing along the x axes. Maps to a command-line argument: -sx %f.

sy_vala float

Final grid spacing along the y axes. Maps to a command-line argument: -sy %f.

sz_vala float

Final grid spacing along the z axes. Maps to a command-line argument: -sz %f.

vel_flaga boolean

Use velocity field integration. Maps to a command-line argument: -vel.

verbosity_off_flaga boolean

Turn off verbose output. Maps to a command-line argument: -voff.

Outputs

avg_outputa string

Output string in the format for reg_average.

cpp_filea pathlike object or string representing a file

The output CPP file.

invcpp_filea pathlike object or string representing a file

The output inverse CPP file.

invres_filea pathlike object or string representing a file

The output inverse res file.

res_filea pathlike object or string representing a file

The output resampled image.