3
d	                 @   sh   d dl Z ddlmZ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 )    N   )traitsTraitedSpecFileCommandLineCommandLineInputSpecInputMultiPath   )split_filenamec               @   sn   e Zd ZeedddddddZejddd	d
ddddddddZejdddddddddd	Z	eddddZ
dS ) ImageStatsInputSpecT)existsz
-images %s   zWList of images to process. They must be in the same space and have the same dimensions.)argstr	mandatorypositiondescminmaxZmeanZmediansumZstdvarz-stat %sZNAzThe statistic to compute.)r   Zunitsr   r   floatcharshortintlongdoublez-outputdatatype %szCA Camino data type string, default is "float". Type must be signed.)r   Z
usedefaultr   z-outputroot %szmFilename root prepended onto the names of the output  files. The extension will be determined from the input.)r   r   r   N)__name__
__module____qualname__r   r   in_filesr   EnumstatZout_typeoutput_root r$   r$   @/tmp/pip-build-7vycvbft/nipype/nipype/interfaces/camino/utils.pyr      s@   r   c               @   s   e Zd ZedddZdS )ImageStatsOutputSpecTz3Path of the file computed with the statistic chosen)r   r   N)r   r   r   r   out_filer$   r$   r$   r%   r&   >   s   r&   c               @   s,   e Zd ZdZdZeZeZdd Z	dd Z
dS )
ImageStatsa  
    This program computes voxelwise statistics on a series of 3D images. The images
    must be in the same space; the operation is performed voxelwise and one output
    is produced per voxel.

    Examples
    --------

    >>> import nipype.interfaces.camino as cam
    >>> imstats = cam.ImageStats()
    >>> imstats.inputs.in_files = ['im1.nii','im2.nii','im3.nii']
    >>> imstats.inputs.stat = 'max'
    >>> imstats.run()                  # doctest: +SKIP
    Z
imagestatsc             C   s$   | j  j }tjj| j |d< |S )Nr'   )output_specgetospathabspath_gen_outfilename)selfoutputsr$   r$   r%   _list_outputsX   s    zImageStats._list_outputsc             C   s*   | j j}| j jd }t|\}}}|| S )Nr   )inputsr#   r    r
   )r/   r#   Z
first_file_extr$   r$   r%   r.   ]   s    zImageStats._gen_outfilenameN)r   r   r   __doc__Z_cmdr   Z
input_specr&   r)   r1   r.   r$   r$   r$   r%   r(   D   s   r(   )r+   baser   r   r   r   r   r   Zutils.filemanipr
   r   r&   r(   r$   r$   r$   r%   <module>   s
    /