3
Xd                 @   sZ   d dl Z d dlZd dlZd dlZd dlmZmZ d dl	j
jZejje dddd ZdS )    N)modelno_freesurferzfreesurfer is not installed)reasonc             C   s  | j   | jdj}| jdj}d}tjdtjd}tjdtjd}tj||fdd}tj|dd}t	j
|tjd	d
j| t	j
|tjd	d
j| tj||gdj }|jj| jdjksttjt	jdj |sttj||g|dj }|jj| j|jksttjt	j|j |s*ttjd| jd}	tjtj||g|ddd}
|	j|
g |	j  tjt	j| jdd|jj |sttj||g|ddj }tjt	j|j |std S )Nz	cont1.niiz	cont2.niizbar.nii      )Zdtype   )Zaxis   )Zaffine)in_fileszconcat_output.nii.gz)r	   concatenated_filetest_concatenate)base_dirconcat)namemean)r	   r
   stats)r   r   r   r   )r   r   r   r   )chdirjoinZstrpathnpZzerosZfloat32ZonesZconcatenater   nbZNifti1ImageZeyeto_filenamer   ZConcatenaterunoutputsr
   AssertionErrorZallcloseloadZ	get_fdatapeZWorkflowNodeZ	add_nodes)ZtmpdirZin1Zin2outZdata1Zdata2Zout_dataZ	mean_dataresZwfr    r   _/var/www/html/virt/lib/python3.6/site-packages/nipype/interfaces/freesurfer/tests/test_model.pyr      s6    r   )osZnumpyr   Znibabelr   ZpytestZnipype.interfaces.freesurferr   r   Znipype.pipeline.engineZpipelineZenginer   markZskipifr   r   r   r   r   <module>   s   