[Nipype] ApplyDeformations : not identifying def parameter file

54 views
Skip to first unread message

Pankaj Singh

unread,
Dec 6, 2013, 4:53:03 PM12/6/13
to nipy...@googlegroups.com
Hi,

I am using spm ApplyDeformations utility and it's throwing errors. Below are my commands and the output :

>>> deform = pe.Node(interface = spm.preprocess.ApplyDeformations(),name = 'deform')
>>> deform.inputs.in_files = brainmask
>>> deform.inputs.deformation_field = parameter_file
>>> deform.inputs.reference_volume = asl_img
>>> deform.inputs.interp = 7
>>> deform.base_dir = '.'
>>> deform.run()
131206-15:49:21,606 workflow INFO:
     Executing node deform in dir: /mounts/data/data1/lab_scripts/AslProc/v4/alpha/deform
/usr/lib/python2.6/site-packages/nipype/interfaces/spm/base.py:45: DeprecationWarning: Please use the shape property instead of get_shape
  shape = img.get_shape()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/usr/lib/python2.6/site-packages/nipype/pipeline/engine.py", line 1496, in _run_interface
    self._result = self._run_command(execute)
  File "/usr/lib/python2.6/site-packages/nipype/pipeline/engine.py", line 1622, in _run_command
    result = self._interface.run()
  File "/usr/lib/python2.6/site-packages/nipype/interfaces/base.py", line 946, in run
    runtime = self._run_interface(runtime)
  File "/usr/lib/python2.6/site-packages/nipype/interfaces/spm/base.py", line 281, in _run_interface
    deepcopy(self._parse_inputs()))
  File "/usr/lib/python2.6/site-packages/nipype/interfaces/spm/base.py", line 321, in _parse_inputs
    dictref[fields[-1]] = self._format_arg(name, spec, value)
  File "/usr/lib/python2.6/site-packages/nipype/interfaces/spm/preprocess.py", line 1162, in _format_arg
    return scans_for_fnames(val, keep4d=True, separate_sessions=False)
  File "/usr/lib/python2.6/site-packages/nipype/interfaces/spm/base.py", line 97, in scans_for_fnames
    if func_is_3d(fnames[0]):
  File "/usr/lib/python2.6/site-packages/nipype/interfaces/spm/base.py", line 44, in func_is_3d
    img = load(in_file)
  File "/usr/lib/python2.6/site-packages/nibabel-1.3.0-py2.6.egg/nibabel/loadsave.py", line 39, in load
    filename)
nibabel.spatialimages.ImageFileError: Cannot work out file type of "/mounts/data/preprocessed/visits/johnson.predict.visit1/pdt00123/asl/T1_FS_sn.mat"
Interface ApplyDeformations failed to run.


Is it that the interface does not accept the parameter file? If so, then how can I get the deformation field from the parameter file?

Regards,
Pankaj

Michael

unread,
Dec 7, 2013, 10:38:19 AM12/7/13
to nipy...@googlegroups.com
Hi Pankaj,

I think what you are looking for is ApplyTransform in spm.utils
Reply all
Reply to author
Forward
0 new messages