3
d8                 @   s   d Z ddlZddlmZmZmZmZ ddlmZ ddlm	Z	 ej
Z
ejded	 G d
d deZG dd deZG dd deZdS )z
The fusion module provides higher-level interfaces to some of the operations
that can be performed with the seg_DetectLesions command-line program.
    N   )TraitedSpecFiletraitsCommandLineInputSpec   )NiftySegCommand)get_custom_pathalways)categoryc               @   s   e Zd ZdZeddddddZeddddd	dZed
dddddZedgdddddZe	j
dddZdZe	j
eddZe	j
dddZe	j
dddZdZe	j
eddZdS )PatchMatchInputSpeczInput Spec for PatchMatch.z-i %sTzInput image to segmentr   )argstrexists	mandatorydescpositionz-m %sz0Input mask for the area where applies PatchMatchr   z-db %szDatabase with the segmentations   in_filez%s_pm.nii.gzz-The output filename of the patchmatch resultsz-o %s   )Zname_sourceZname_templater   r   r   zPatch size, #voxelsz-size %i)r   r   zGConstrained search area size, number of times bigger than the patchsizez-cs %izNumber of better matchingz	-match %izNumber of patchmatch executionsz-pm %iz1Number of iterations for the patchmatch algorithmz-it %iN)__name__
__module____qualname____doc__r   r   Z	mask_fileZdatabase_fileout_filer   ZIntZ
patch_sizer   Zcs_sizeZ	match_numZpm_numZit_num r   r   G/tmp/pip-build-7vycvbft/nipype/nipype/interfaces/niftyseg/patchmatch.pyr      s@   r   c               @   s   e Zd ZdZeddZdS )PatchMatchOutputSpeczOutputSpec for PatchMatch.zOutput segmentation)r   N)r   r   r   r   r   r   r   r   r   r   r   G   s   r   c               @   s(   e Zd ZdZedddZeZeZ	dZ
dS )
PatchMatcha  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 <http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg>`_ |
    `Documentation <http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg_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'

    Zseg_PatchMatchZNIFTYSEGDIR)Zenv_dirZ_pmN)r   r   r   r   r	   Z_cmdr   Z
input_specr   Zoutput_spec_suffixr   r   r   r   r   M   s
   r   )r   warningsbaser   r   r   r   r   Zniftyreg.baser	   warnfilterwarningsUserWarningr   r   r   r   r   r   r   <module>   s   5