nipype.interfaces.niftyseg.em module

Nipype interface for seg_EM.

The em module provides higher-level interfaces to some of the operations that can be performed with the seg_em command-line program.

Examples

See the docstrings of the individual classes for examples.

EM

Link to code

Bases: NiftySegCommand

Wrapped executable: seg_EM.

Interface for executable seg_EM from NiftySeg platform.

seg_EM is a general purpose intensity based image segmentation tool. In it’s simplest form, it takes in one 2D or 3D image and segments it in n classes.

Source code | Documentation

Examples

>>> from nipype.interfaces import niftyseg
>>> node = niftyseg.EM()
>>> node.inputs.in_file = 'im1.nii'
>>> node.inputs.no_prior = 4
>>> node.cmdline
'seg_EM -in im1.nii -bc_order 3 -bc_thresh 0 -max_iter 100 -min_iter 0 -nopriors 4 -bc_out im1_bc_em.nii.gz -out im1_em.nii.gz -out_outlier im1_outlier_em.nii.gz'
in_filea pathlike object or string representing an existing file

Input image to segment. Maps to a command-line argument: -in %s (position: 4).

no_prioran integer (int or long)

Number of classes to use without prior. Maps to a command-line argument: -nopriors %s. Mutually exclusive with inputs: prior_4D, priors.

prior_4Da pathlike object or string representing an existing file

4D file containing the priors. Maps to a command-line argument: -prior4D %s. Mutually exclusive with inputs: no_prior, priors.

priorsa list of items which are any value

List of priors filepaths. Maps to a command-line argument: %s. Mutually exclusive with inputs: no_prior, prior_4D.

argsa unicode string

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

bc_order_valan integer (int or long)

Polynomial order for the bias field. Maps to a command-line argument: -bc_order %s. (Nipype default value: 3)

bc_thresh_vala float

Bias field correction will run only if the ratio of improvement is below bc_thresh. (default=0 [OFF]). Maps to a command-line argument: -bc_thresh %s. (Nipype default value: 0)

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: {})

mask_filea pathlike object or string representing an existing file

Filename of the ROI for label fusion. Maps to a command-line argument: -mask %s.

max_iteran integer (int or long)

Maximum number of iterations. Maps to a command-line argument: -max_iter %s. (Nipype default value: 100)

min_iteran integer (int or long)

Minimum number of iterations. Maps to a command-line argument: -min_iter %s. (Nipype default value: 0)

mrf_beta_vala float

Weight of the Markov Random Field. Maps to a command-line argument: -mrf_beta %s.

out_bc_filea pathlike object or string representing a file

Output bias corrected image. Maps to a command-line argument: -bc_out %s.

out_filea pathlike object or string representing a file

Output segmentation. Maps to a command-line argument: -out %s.

out_outlier_filea pathlike object or string representing a file

Output outlierness image. Maps to a command-line argument: -out_outlier %s.

outlier_vala tuple of the form: (a float, a float)

Outlier detection as in (Van Leemput TMI 2003). <fl1> is the Mahalanobis threshold [recommended between 3 and 7] <fl2> is a convergence ratio below which the outlier detection is going to be done [recommended 0.01]. Maps to a command-line argument: -outlier %s %s.

reg_vala float

Amount of regularization over the diagonal of the covariance matrix [above 1]. Maps to a command-line argument: -reg %s.

relax_priorsa tuple of the form: (a float, a float)

Relax Priors [relaxation factor: 0<rf<1 (recommended=0.5), gaussian regularization: gstd>0 (recommended=2.0)] /only 3D/. Maps to a command-line argument: -rf %s %s.

out_bc_filea pathlike object or string representing a file

Output bias corrected image.

out_filea pathlike object or string representing a file

Output segmentation.

out_outlier_filea pathlike object or string representing a file

Output outlierness image.