3
d                 @   sd   d Z ddlZddlmZmZmZmZmZmZm	Z	 G dd deZ
G dd deZG d	d
 d
eZdS )zAThe bru2nii module provides basic functions for dicom conversion
    N   )CommandLineCommandLineInputSpectraitsTraitedSpec	isdefinedFile	Directoryc               @   sf   e Zd ZeddddddZejdddZejd	d
dZejdddZ	ejdddZ
ejddddZdS )Bru2InputSpeczInput DirectoryTr   z%s)descexists	mandatorypositionargstrz-az>Keep actual size - otherwise x10 scale so animals match human.)r   r   z-fzDForce conversion of localizers images (multiple slice orientations).z-zzgz compress images (".nii.gz").z-pz(Append protocol name to output filename.z-o %sz_Output filename (".nii" will be appended, or ".nii.gz" if the "-z" compress option is selected))r   r   ZgenfileN)__name__
__module____qualname__r	   	input_dirr   ZBoolZactual_sizeZforce_conversioncompressZappend_protocol_nameStroutput_filename r   r   ;/tmp/pip-build-7vycvbft/nipype/nipype/interfaces/bru2nii.pyr
      s   
r
   c               @   s   e Zd ZeddZdS )Bru2OutputSpecT)r   N)r   r   r   r   nii_filer   r   r   r   r   (   s   r   c               @   s,   e Zd ZdZeZeZd Zdd Z	dd Z
dS )Bru2a&  Uses bru2nii's Bru2 to convert Bruker files

    Examples
    ========

    >>> from nipype.interfaces.bru2nii import Bru2
    >>> converter = Bru2()
    >>> converter.inputs.input_dir = "brukerdir"
    >>> converter.cmdline  # doctest: +ELLIPSIS
    'Bru2 -o .../data/brukerdir brukerdir'
    c             C   sZ   | j  j }t| jjr*tjj| jj}n
| jd}| jj	rJ|d |d< n|d |d< |S )Nr   z.nii.gzr   z.nii)
Z_outputsgetr   inputsr   ospathabspath_gen_filenamer   )selfoutputsZoutput_filename1r   r   r   _list_outputs=   s    
zBru2._list_outputsc             C   s6   |dkr2t jjt j t jjt jj| jj}|S d S )Nr   )r   r    joingetcwdbasenamenormpathr   r   )r#   nameoutfiler   r   r   r"   I   s     zBru2._gen_filenameN)r   r   r   __doc__r
   Z
input_specr   Zoutput_specZ_cmdr%   r"   r   r   r   r   r   ,   s   r   )r,   r   baser   r   r   r   r   r   r	   r
   r   r   r   r   r   r   <module>   s
   $