3
dL                 @   s   d Z ddlZdddZdS )z=Image manipulation utilities (mostly, NiBabel manipulations).    NTc             C   sd   t j| }t j|dd}|jj }|r4|j|j  |j|jd|}|sV|j|j  |j| |S )z6Copy header from a reference image onto another image.F)ZmmapN)	nbloadheadercopyZset_data_dtypeZget_data_dtype	__class__Zdataobjto_filename)Zheader_filein_fileZ
keep_dtypeZhdr_imgZout_imghdrZnew_img r
   9/tmp/pip-build-7vycvbft/nipype/nipype/utils/imagemanip.pycopy_header   s    


r   )T)__doc__Znibabelr   r   r
   r
   r
   r   <module>   s   