3
dA                 @   s`   d Z ddlmZmZmZmZmZ ddlmZ G dd deZ	G dd deZ
G d	d
 d
eZdS )z4Quickshear is a simple geometric defacing algorithm.   )CommandLineInputSpecCommandLinetraitsTraitedSpecFile   )BibTeXc               @   sT   e 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dZejddddZ	dS )QuickshearInputSpecTr   z%szneuroimage to deface)existspositionargstr	mandatorydescr   z
brain mask)r
   r   r   r   r   z
%s_defacedin_file   zdefaced output image)Zname_templateZname_sourcer   r   r   Zkeep_extension   z%dz<buffer size (in voxels) between shearing plane and the brain)r   r   r   N)
__name__
__module____qualname__r   r   Z	mask_fileout_filer   ZIntZbuff r   r   >/tmp/pip-build-7vycvbft/nipype/nipype/interfaces/quickshear.pyr	      s&   r	   c               @   s   e Zd ZedddZdS )QuickshearOutputSpecTzdefaced output image)r
   r   N)r   r   r   r   r   r   r   r   r   r   "   s   r   c               @   s.   e Zd ZdZdZeZeZe	ddgdgZ
dS )
Quicksheara  
    Quickshear is a simple geometric defacing algorithm

    Given an anatomical image and a reasonable brainmask, Quickshear estimates
    a shearing plane with the brain mask on one side and the face on the other,
    zeroing out the face side.

    >>> from nipype.interfaces.quickshear import Quickshear
    >>> qs = Quickshear(in_file='T1.nii', mask_file='brain_mask.nii')
    >>> qs.cmdline
    'quickshear T1.nii brain_mask.nii T1_defaced.nii'

    In the absence of a precomputed mask, a simple pipeline can be generated
    with any tool that generates brain masks:

    >>> from nipype.pipeline import engine as pe
    >>> from nipype.interfaces import utility as niu
    >>> from nipype.interfaces.fsl import BET
    >>> deface_wf = pe.Workflow('deface_wf')
    >>> inputnode = pe.Node(niu.IdentityInterface(['in_file']),
    ...                     name='inputnode')
    >>> outputnode = pe.Node(niu.IdentityInterface(['out_file']),
    ...                      name='outputnode')
    >>> bet = pe.Node(BET(mask=True), name='bet')
    >>> quickshear = pe.Node(Quickshear(), name='quickshear')
    >>> deface_wf.connect([
    ...     (inputnode, bet, [('in_file', 'in_file')]),
    ...     (inputnode, quickshear, [('in_file', 'in_file')]),
    ...     (bet, quickshear, [('mask_file', 'mask_file')]),
    ...     (quickshear, outputnode, [('out_file', 'out_file')]),
    ...     ])
    >>> inputnode.inputs.in_file = 'T1.nii'
    >>> res = deface_wf.run()  # doctest: +SKIP
    Z
quicksheara  @inproceedings{Schimke2011,address = {San Francisco},author = {Schimke, Nakeisha and Hale, John},booktitle = {Proceedings of the 2nd USENIX Conference on Health Security and Privacy},title = {{Quickshear Defacing for Neuroimages}},year = {2011},month = sep}implementation)entrytagsN)r   r   r   __doc__Z_cmdr	   Z
input_specr   Zoutput_specr   Z_referencesr   r   r   r   r   &   s   "	r   N)r   baser   r   r   r   r   Zexternal.duer   r	   r   r   r   r   r   r   <module>   s
   