interfaces.niftyseg.label_fusion

CalcTopNCC

Link to code

Wraps the executable command seg_CalcTopNCC.

Interface for executable seg_CalcTopNCC from NiftySeg platform.

Examples

>>> from nipype.interfaces import niftyseg
>>> node = niftyseg.CalcTopNCC()
>>> node.inputs.in_file = 'im1.nii'
>>> node.inputs.num_templates = 2
>>> node.inputs.in_templates = ['im2.nii', 'im3.nii']
>>> node.inputs.top_templates = 1
>>> node.cmdline
'seg_CalcTopNCC -target im1.nii -templates 2 im2.nii im3.nii -n 1'

Inputs:

[Mandatory]
in_file: (an existing file name)
        Target file
        argument: ``-target %s``, position: 1
num_templates: (an integer (int or long))
        Number of Templates
        argument: ``-templates %s``, position: 2
in_templates: (a list of items which are an existing file name)
        argument: ``%s``, position: 3
top_templates: (an integer (int or long))
        Number of Top Templates
        argument: ``-n %s``, position: 4

[Optional]
mask_file: (an existing file name)
        Filename of the ROI for label fusion
        argument: ``-mask %s``
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:

out_files: (any value)

LabelFusion

Link to code

Wraps the executable command seg_LabFusion.

Interface for executable seg_LabelFusion from NiftySeg platform using type STEPS as classifier Fusion.

This executable implements 4 fusion strategies (-STEPS, -STAPLE, -MV or - SBA), all of them using either a global (-GNCC), ROI-based (-ROINCC), local (-LNCC) or no image similarity (-ALL). Combinations of fusion algorithms and similarity metrics give rise to different variants of known algorithms. As an example, using LNCC and MV as options will run a locally weighted voting strategy with LNCC derived weights, while using STAPLE and LNCC is equivalent to running STEPS as per its original formulation. A few other options pertaining the use of an MRF (-MRF beta), the initial sensitivity and specificity estimates and the use of only non-consensus voxels (-unc) for the STAPLE and STEPS algorithm. All processing can be masked (-mask), greatly reducing memory consumption.

As an example, the command to use STEPS should be: seg_LabFusion -in 4D_Propragated_Labels_to_fuse.nii -out FusedSegmentation.nii -STEPS 2 15 TargetImage.nii 4D_Propagated_Intensities.nii

Source code | Documentation

Examples

>>> from nipype.interfaces import niftyseg
>>> node = niftyseg.LabelFusion()
>>> node.inputs.in_file = 'im1.nii'
>>> node.inputs.kernel_size = 2.0
>>> node.inputs.file_to_seg = 'im2.nii'
>>> node.inputs.template_file = 'im3.nii'
>>> node.inputs.template_num = 2
>>> node.inputs.classifier_type = 'STEPS'
>>> node.cmdline
'seg_LabFusion -in im1.nii -STEPS 2.000000 2 im2.nii im3.nii -out im1_steps.nii'

Inputs:

[Mandatory]
in_file: (an existing file name)
        Filename of the 4D integer label image.
        argument: ``-in %s``, position: 1
file_to_seg: (an existing file name)
        Original image to segment (3D Image)
classifier_type: ('STEPS' or 'STAPLE' or 'MV' or 'SBA')
        Type of Classifier Fusion.
        argument: ``-%s``, position: 2

[Optional]
template_file: (an existing file name)
        Registered templates (4D Image)
mask_file: (an existing file name)
        Filename of the ROI for label fusion
        argument: ``-mask %s``
out_file: (a file name)
        Output consensus segmentation
        argument: ``-out %s``
prob_flag: (a boolean)
        Probabilistic/Fuzzy segmented image
        argument: ``-outProb``
verbose: ('0' or '1' or '2')
        Verbose level [0 = off, 1 = on, 2 = debug] (default = 0)
        argument: ``-v %s``
unc: (a boolean)
        Only consider non-consensus voxels to calculate statistics
        argument: ``-unc``
kernel_size: (a float)
        Gaussian kernel size in mm to compute the local similarity
template_num: (an integer (int or long))
        Number of labels to use
sm_ranking: ('ALL' or 'GNCC' or 'ROINCC' or 'LNCC', nipype default
          value: ALL)
        Ranking for STAPLE and MV
        argument: ``-%s``, position: 3
dilation_roi: (an integer (int or long))
        Dilation of the ROI ( <int> d>=1 )
proportion: (a float)
        Proportion of the label (only for single labels).
        argument: ``-prop %s``
prob_update_flag: (a boolean)
        Update label proportions at each iteration
        argument: ``-prop_update``
set_pq: (a tuple of the form: (a float, a float))
        Value of P and Q [ 0 < (P,Q) < 1 ] (default = 0.99 0.99)
        argument: ``-setPQ %f %f``
mrf_value: (a float)
        MRF prior strength (between 0 and 5)
        argument: ``-MRF_beta %f``
max_iter: (an integer (int or long))
        Maximum number of iterations (default = 15).
        argument: ``-max_iter %d``
unc_thresh: (a float)
        If <float> percent of labels agree, then area is not uncertain.
        argument: ``-uncthres %f``
conv: (a float)
        Ratio for convergence (default epsilon = 10^-5).
        argument: ``-conv %f``
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:

out_file: (an existing file name)
        image written after calculations