interfaces.niftyseg.patchmatch

PatchMatch

Link to code

Wraps the executable command seg_PatchMatch.

Interface for executable seg_PatchMatch from NiftySeg platform.

The database file is a text file and in each line we have a template file, a mask with the search region to consider and a file with the label to propagate.

Input image, input mask, template images from database and masks from database must have the same 4D resolution (same number of XxYxZ voxels, modalities and/or time-points). Label files from database must have the same 3D resolution (XxYxZ voxels) than input image but can have different number of volumes than the input image allowing to propagate multiple labels in the same execution.

Source code | Documentation

Examples

>>> from nipype.interfaces import niftyseg
>>> node = niftyseg.PatchMatch()
>>> node.inputs.in_file = 'im1.nii'
>>> node.inputs.mask_file = 'im2.nii'
>>> node.inputs.database_file = 'db.xml'
>>> node.cmdline
'seg_PatchMatch -i im1.nii -m im2.nii -db db.xml -o im1_pm.nii.gz'

Inputs:

[Mandatory]
in_file: (an existing file name)
        Input image to segment
        argument: ``-i %s``, position: 1
mask_file: (an existing file name)
        Input mask for the area where applies PatchMatch
        argument: ``-m %s``, position: 2
database_file: (an existing file name)
        Database with the segmentations
        argument: ``-db %s``, position: 3

[Optional]
out_file: (a file name)
        The output filename of the patchmatch results
        argument: ``-o %s``, position: 4
patch_size: (an integer (int or long))
        Patch size, #voxels
        argument: ``-size %i``
cs_size: (an integer (int or long))
        Constrained search area size, number of times bigger than the
        patchsize
        argument: ``-cs %i``
match_num: (an integer (int or long))
        Number of better matching
        argument: ``-match %i``
pm_num: (an integer (int or long))
        Number of patchmatch executions
        argument: ``-pm %i``
it_num: (an integer (int or long))
        Number of iterations for the patchmatch algorithm
        argument: ``-it %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:

out_file: (a file name)
        Output segmentation