Hi I am trying to run Freesurfer’s mri_normalize on nypype using the Freersurfer interface Normalize.
I want this run on a list of files using MapNode, but I get an error. I wrote a code snippet that reproduces the error.
(error message at the end)
from nipype.interfaces.freesurfer.preprocess import MNIBiasCorrection, Normalize
import nipype.pipeline.engine as pe
normalizer = pe.MapNode(interface=Normalize(),
iterfield=['in_file'],
name='normalizer')
normalizer.inputs.in_file = [u'/data1/cooked/AAD/XXX5484092/visit_4/T1W/XXX5484092_visit_4_T1W_N708XXX.nii.gz',
u'/data1/cooked/TNf/XXX5484092/visit_1/T1W/XXX5484092_visit_1_T1W_N752922.nii.gz',
u'/data1/cooked/TNf/XXX5484092/visit_2/T1W/XXX5484092_visit_2_T1W_N902212.nii.gz']
normalizer.base_dir = '/data1/pipelines/temp'
normalizer.run()
The error messae I get is:
Exception: Subnodes of node: normalizer failed:
Subnode 0 failed
Error:
‘_Undefined’ object has no attribute ‘startswith’
Interface Normalize failed to run.
Subnode 1 failed
Error:
‘_Undefined’ object has no attribute ‘startswith’
Interface Normalize failed to run.
Subnode 2 failed
Error:
‘_Undefined’ object has no attribute ‘startswith’
Interface Normalize failed to run.
This is the content of the report.rst file of Subnode 0. It should be noted that it produces and output file that looks fine.
Node: freesurfer
Hierarchy : _normalizer0
Exec ID : _normalizer0
Original Inputs
- args :
- environ : {u’SUBJECTS_DIR’: ‘/home/TTI/opt/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0/subjects’}
- gradient :
- ignore_exception : False
- in_file : /data1/cooked/AAD/XXX5484092/visit_4/T1W/XXX5484092_visit_4_T1W_N708XXX.nii.gz
- mask :
- out_file :
- segmentation :
- subjects_dir : /home/TTI/opt/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0/subjects
- terminal_output : stream
- transform :
It should also be noted that the code doesn’t crash I if use another interface such as MNIBiasCorrection instead of Normalize.
The question is: Why does it crash? Am I making a mistake? I suspect that it is a bug, but need confirmation.
Thank you!
Pablo