3
dh                 @   sh   d Z ddlmZmZmZmZ ddl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 )zJ
The ASL module of niftyfit, which wraps the fitting methods in NiftyFit.
   )FileTraitedSpectraitsCommandLineInputSpec   )NiftyFitCommand)get_custom_pathc               @   sx  e Zd ZdZdZeddddedZejddd	Z	ejd
dd	Z
dZedgddedZedgddddZedgddddZdZeddedZdZeddedZdZeddedZdZeddedZd Zedd!edZed"dd#d$d%Zejd&d'd	Zd(Zejed)d	Zd*Zejed+d	Zd,Zejed-d	Zejd.d/d	Zejd0d1d	Zd2Zejed3d	Zejd4d5d	Zejd6d7d	Zd8Zejed9d	Zejd:d;d	Zejd<d=d	Z ejd>d?d	Z!ejd@dAd	Z"ejdBdCd	Z#ejdDdEd	Z$dFZeddGedZ%dHZejedId	Z&dJZej'edKd	Z(ej'dLdMd	Z)ej*ej'ej'ej'dNdOd	Z+dPZejedQd	Z,ejdRdId	Z-dSZejedTd	Z.ejdUdVd	Z/dWS )XFitAslInputSpeczInput Spec for FitAsl.z@Filename of the 4D ASL (control/label) source image (mandatory).r   Tz
-source %s)positionexistsargstr	mandatorydesczFit PASL ASL data [default]z-pasl)r   r   zFit PCASL ASL dataz-pcaslz9Filename of the Cerebral Blood Flow map (in ml/100g/min).source_filez%s_cbf.nii.gzz-cbf %s)Zname_sourceZname_templater   r   z%s_error.nii.gzz	-error %szFilename of the CBF error map.z%s_syn.nii.gzz-syn %sz#Filename of the synthetic ASL data.z/Filename of the estimated input T1 map (in ms).z	-t1map %s)r   r   r   z'Filename of the estimated input M0 map.z	-m0map %sz-Filename of the estimated input M0 map error.z
-m0mape %szXFilename of a [1,2,5]s Inversion Recovery volume (T1/M0 fitting carried out internally).z-IRvolume %sz.Output of [1,2,5]s Inversion Recovery fitting.z-IRoutput %sr   zFilename of image mask.z-mask %s)r
   r   r   r   z"T1 of arterial component [1650ms].z-T1a %fz5Single plasma/tissue partition coefficient [0.9ml/g].z-L %fzoLabelling efficiency [0.99 (pasl), 0.85 (pcasl)], ensure any background suppression pulses are included in -effz-eff %fzROutlier rejection for multi CL volumes (enter z-score threshold (e.g. 2.5)) [off].z-out %fzPost Labelling Delay [2000ms].z-PLD %fzLabelling Duration [1800ms].z-LDD %fz6Difference in labelling delay per slice [0.0 ms/slice.z-dPLD %fzSaturation pulse time [800ms].z	-Tinv1 %fzInversion time [2000ms].z	-Tinv2 %fz3Difference in inversion time per slice [0ms/slice].z
-dTinv2 %fzT1 of GM [1150ms].z-gmT1 %fz%Plasma/GM water partition [0.95ml/g].z-gmL %fzTime to GM [ATT+0ms].z	-gmTTT %fzT1 of WM [800ms].z-wmT1 %fz%Plasma/WM water partition [0.82ml/g].z-wmL %fzTime to WM [ATT+0ms].z	-wmTTT %fzaFilename of the 4D segmentation (in ASL space) for L/T1 estimation and PV correction {WM,GM,CSF}.z-seg %sz7Use sigmoid to estimate L from T1: L(T1|gmL,wmL) [Off].z-sigzFSimple PV correction (CBF=vg*CBFg + vw*CBFw, with CBFw=f*CBFg) [0.25].z-pv0 %dzIn plane PV kernel size [3x3].z-pv2 %dz3D kernel size [3x3x1].z-pv3 %d %d %dzAMultiply CBF by this value (e.g. if CL are mislabelled use -1.0).z-mul %fz#Multiply CBF by segmentation [Off].z/Set PV threshold for switching off LSQR [O.05].z-pvthresholdzSet CBF as [gm,wm] not [wm,gm].z	-segstyleN)0__name__
__module____qualname____doc__r   r   r   r   ZBoolZpaslZpcaslcbf_file
error_filesyn_fileZt1mapZm0mapZm0mapeZ	ir_volumeZ	ir_outputmaskZFloatZ
t1_art_cmpZplasma_coeffZeffoutZpldZlddZdpldZt_inv1Zt_inv2Zdt_inv2Zgm_t1Z	gm_plasmaZgm_tttZwm_t1Z	wm_plasmaZwm_tttsegsigZIntZpv0Zpv2TupleZpv3mulZmulgmZpv_thresholdZsegstyle r   r   @/tmp/pip-build-7vycvbft/nipype/nipype/interfaces/niftyfit/asl.pyr	      s   


r	   c               @   s@   e Zd ZdZdZededZdZededZdZededZdS )FitAslOutputSpeczOutput Spec for FitAsl.z9Filename of the Cerebral Blood Flow map (in ml/100g/min).T)r   r   zFilename of the CBF error map.z#Filename of the synthetic ASL data.N)	r   r   r   r   r   r   r   r   r   r   r   r   r   r      s   r   c               @   s(   e Zd ZdZedddZeZeZ	dZ
dS )FitAslaK  Interface for executable fit_asl from Niftyfit platform.

    Use NiftyFit to perform ASL fitting.

    ASL fitting routines (following EU Cost Action White Paper recommendations)
    Fits Cerebral Blood Flow maps in the first instance.

    `Source code <https://cmiclab.cs.ucl.ac.uk/CMIC/NiftyFit-Release>`_

    Examples
    --------
    >>> from nipype.interfaces import niftyfit
    >>> node = niftyfit.FitAsl()
    >>> node.inputs.source_file = 'asl.nii.gz'
    >>> node.cmdline
    'fit_asl -source asl.nii.gz -cbf asl_cbf.nii.gz -error asl_error.nii.gz -syn asl_syn.nii.gz'

    Zfit_aslZNIFTYFITDIR)Zenv_dirZ_fit_aslN)r   r   r   r   r   Z_cmdr	   Z
input_specr   Zoutput_spec_suffixr   r   r   r   r       s
   r    N)r   baser   r   r   r   r   Zniftyreg.baser   r	   r   r    r   r   r   r   <module>   s   w