3
Xd                 @   s\   d dl mZ ddlmZ ddlZddlZej dd Zej dd	 Zd
d Zdd Z	dS )   )LaplacianThickness   )
change_dir    Nc                sV   t j  t jjt jjt}t jjt jj|d}t j|  fdd}| j| d S )Nz../../../testing/datac                  s   t j  d S )N)oschdir )orig_dirr   `/var/www/html/virt/lib/python3.6/site-packages/nipype/interfaces/ants/tests/test_segmentation.py	move2orig   s    zchange_dir.<locals>.move2orig)	r   getcwdpathdirnamerealpath__file__joinr   Zaddfinalizer)requestfilepathZdatadirr   r   )r	   r
   r      s    
r   c              C   s   t  } d| j_d| j_| S )Nzdiffusion_weighted.niizfunctional.nii)r   inputsZinput_gmZinput_wm)ltr   r   r
   	create_lt   s    r   c             C   sN   |}d}|j |kstd|j_|j |d ks0td|j_|j |d ksJtd S )NzQLaplacianThickness functional.nii diffusion_weighted.nii functional_thickness.niig      @z 4.5g@z 4.5 5.9)cmdlineAssertionErrorr   smooth_paramprior_thickness)r   r   r   Zbase_cmdr   r   r
    test_LaplacianThickness_defaults!   s    r   c             C   s   |}d|j _tjtdd |j W d Q R X d|j _tjtdd |j W d Q R X d|j _tjtdd |j W d Q R X d|j _tjtd	d |j W d Q R X d
|j _	|jdkst
d S )NgMbP?z/.* requires a value for input 'sulcus_prior' .*)matchg333333?z%.* requires a value for input 'dT' .*g{Gz?z2.* requires a value for input 'prior_thickness' .*g@z/.* requires a value for input 'smooth_param' .*g      @ziLaplacianThickness functional.nii diffusion_weighted.nii functional_thickness.nii 4.5 5.9 0.01 0.15 0.001)r   Z	tolerancepytestZraises
ValueErrorr   Zsulcus_priorZdTr   r   r   )r   r   r   r   r   r
   !test_LaplacianThickness_wrongargs+   s$    r   )
Zsegmentationr   Ztest_resamplingr   r   r   Zfixturer   r   r   r   r   r   r
   <module>   s   	
