Skip to content

ICA_AROMA() not working #2026

Closed
Closed
@debottamKundu

Description

@debottamKundu

Summary

The newly released version 0.13.0 has a ICA_AROMA() interface defined in the fsl module but although the AROMA is executing correctly, it is throwing an error when passing the output of a node that contains the interface of the AROMA module to another node.

Actual behavior

AROMA node is throwing an "NameError: global name 'outputs' is not defined
Interface ICA_AROMA failed to run" although all the files that are supposed to be generated by AROMA are already in the output directory which is specified via the input.

170516-20:56:40,957 workflow INFO:
Executing node a in dir: /tmp/tmppbBpxu/a
170516-20:56:40,974 workflow INFO:
Running: ICA_AROMA.py -den nonaggr -feat /home/debottam/Desktop/OUTPUT.feat -o /home/debottam/Desktop/OUTPUT.feat/ICA_testout/
170516-21:08:56,984 interface INFO:
stdout 2017-05-16T21:08:56.983846:
170516-21:08:56,986 interface INFO:
stdout 2017-05-16T21:08:56.983846:------------------------------- RUNNING ICA-AROMA -------------------------------
170516-21:08:56,989 interface INFO:
stdout 2017-05-16T21:08:56.983846:--------------- 'ICA-based Automatic Removal Of Motion Artifacts' ---------------
170516-21:08:56,992 interface INFO:
stdout 2017-05-16T21:08:56.983846:
170516-21:08:57,1 interface INFO:
stdout 2017-05-16T21:08:56.983846:Step 1) MELODIC
170516-21:08:57,3 interface INFO:
stdout 2017-05-16T21:08:56.983846: - The existing/specified MELODIC directory will be used.
170516-21:08:57,5 interface INFO:
stdout 2017-05-16T21:08:56.983846: - The MELODIC directory does not contain the required 'stats' folder. Mixture modeling on the Z-statistical maps will be run.
170516-21:08:57,6 interface INFO:
stdout 2017-05-16T21:08:56.983846:Step 2) Automatic classification of the components
170516-21:08:57,8 interface INFO:
stdout 2017-05-16T21:08:56.983846: - registering the spatial maps to MNI
170516-21:08:57,10 interface INFO:
stdout 2017-05-16T21:08:56.983846: - extracting the CSF & Edge fraction features
170516-21:08:57,14 interface INFO:
stdout 2017-05-16T21:08:56.983846: - extracting the Maximum RP correlation feature
170516-21:08:57,17 interface INFO:
stdout 2017-05-16T21:08:56.983846: - extracting the High-frequency content feature
170516-21:08:57,18 interface INFO:
stdout 2017-05-16T21:08:56.983846: - classification
170516-21:08:57,21 interface INFO:
stdout 2017-05-16T21:08:56.983846:Step 3) Data denoising
170516-21:08:57,25 interface INFO:
stdout 2017-05-16T21:08:56.983846:
170516-21:08:57,28 interface INFO:
stdout 2017-05-16T21:08:56.983846:----------------------------------- Finished -----------------------------------
170516-21:08:57,30 interface INFO:
stdout 2017-05-16T21:08:56.983846:

NameError Traceback (most recent call last)
in ()
----> 1 a.run()

/home/debottam/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.pyc in run(self, updatehash)
370 self.inputs.get_traitsfree())
371 try:
--> 372 self._run_interface()
373 except:
374 os.remove(hashfile_unfinished)

/home/debottam/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.pyc in _run_interface(self, execute, updatehash)
480 old_cwd = os.getcwd()
481 os.chdir(self.output_dir())
--> 482 self._result = self._run_command(execute)
483 os.chdir(old_cwd)
484

/home/debottam/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.pyc in _run_command(self, execute, copyfiles)
611 logger.info('Running: %s' % cmd)
612 try:
--> 613 result = self._interface.run()
614 except Exception as msg:
615 self._save_results(result, cwd)

/home/debottam/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.pyc in run(self, **inputs)
1080 try:
1081 runtime = self._run_wrapper(runtime)
-> 1082 outputs = self.aggregate_outputs(runtime)
1083 runtime.endTime = dt.isoformat(dt.utcnow())
1084 timediff = parseutc(runtime.endTime) - parseutc(runtime.startTime)

/home/debottam/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.pyc in aggregate_outputs(self, runtime, needed_outputs)
1151 """ Collate expected outputs and check for existence
1152 """
-> 1153 predicted_outputs = self._list_outputs()
1154 outputs = self._outputs()
1155 if predicted_outputs:

/home/debottam/anaconda2/lib/python2.7/site-packages/nipype/interfaces/fsl/ICA_AROMA.pyc in _list_outputs(self)
109 def _list_outputs(self):
110 out_dir = os.path.abspath(self.inputs.out_dir)
--> 111 outputs['out_dir'] = out_dir
112
113 if self.inputs.denoise_type in ('aggr', 'both'):

NameError: global name 'outputs' is not defined
Interface ICA_AROMA failed to run.

Expected behavior

The outputs is supposed to return the output directory containing the AROMA output

How to replicate the behavior

FEAT is already ran on requisite images and a FEAT folder containing the FEAT files is passed to the AROMA module. An already existing output directory is also passed.

Script/Workflow details

from nipype.pipeline.engine import Node
from nipype import Function
from nipype.interfaces.fsl.maths import TemporalFilter
from nipype.interfaces.fsl import ICA_AROMA
a = Node(ICA_AROMA.ICA_AROMA(),name='a')
a.inputs.feat_dir = '/home/debottam/Desktop/OUTPUT.feat'
a.inputs.out_dir = '/home/debottam/Desktop/OUTPUT.feat/ICA_testout/'
a.run()

Platform details:

Please paste the output of: python -c "import nipype; print(nipype.get_info()); print(nipype.__version__)"
{'nibabel_version': '2.1.0', 'sys_executable': '/home/debottam/anaconda2/bin/python', 'networkx_version': '1.11', 'numpy_version': '1.11.0', 'sys_platform': 'linux2', 'sys_version': '2.7.13 | packaged by conda-forge | (default, May 2 2017, 12:48:11) \n[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]', 'commit_source': u'installation', 'commit_hash': u'fd5b81b7c', 'pkg_path': '/home/debottam/anaconda2/lib/python2.7/site-packages/nipype', 'nipype_version': u'0.13.0', 'traits_version': '4.6.0', 'scipy_version': '0.19.0'}

Execution environment

Jupyter-Notebook
Choose one

  • Container [Tag: Bug]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions