Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleteorientation bug #246

Open
darya-chyzhyk opened this issue Aug 9, 2016 · 10 comments
Open

deleteorientation bug #246

darya-chyzhyk opened this issue Aug 9, 2016 · 10 comments

Comments

@darya-chyzhyk
Copy link

When "deleteorient = True" there is an error:

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/init.py in start_ipython(argv=None, *_kwargs={})
113 kwargs : various, optional
114 Any other kwargs will be passed to the Application constructor,
115 such as config.
116 """
117 from IPython.terminal.ipapp import launch_new_instance
--> 118 return launch_new_instance(argv=argv, *_kwargs)
launch_new_instance = <bound method MetaHasTraits.launch_instance of <class 'IPython.terminal.ipapp.TerminalIPythonApp'>>
argv = None
kwargs = {}
119
120 def start_kernel(argv=None, **kwargs):
121 """Launch a normal IPython kernel instance (as opposed to embedded)
122

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/config/application.py in launch_instance(cls=<class 'IPython.terminal.ipapp.TerminalIPythonApp'>, argv=None, **kwargs={})
541 If a global instance already exists, this reinitializes and starts it
542 """
543 try:
544 app = cls.instance(**kwargs)
545 app.initialize(argv)
--> 546 app.start()
app.start = <bound method TerminalIPythonApp.start of <IPython.terminal.ipapp.TerminalIPythonApp object>>
547 except ImportError as e:
548 from IPython.utils import py3compat
549 ipy = "ipython3" if py3compat.PY3 else "ipython"
550 if "IPython.qt" in str(e) or "qt.console.qtconsoleapp" in str(e):

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/terminal/ipapp.py in start(self=<IPython.terminal.ipapp.TerminalIPythonApp object>)
357 if self.subapp is not None:
358 return self.subapp.start()
359 # perform any prexec steps:
360 if self.interact:
361 self.log.debug("Starting IPython's mainloop...")
--> 362 self.shell.mainloop()
self.shell.mainloop = <bound method TerminalInteractiveShell.mainloop ...nteractiveshell.TerminalInteractiveShell object>>
363 else:
364 self.log.debug("IPython not interactive...")
365
366

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.py in mainloop(self=<IPython.terminal.interactiveshell.TerminalInteractiveShell object>, display_banner=None)
431
432 with nested(self.builtin_trap, self.display_trap):
433
434 while 1:
435 try:
--> 436 self.interact(display_banner=display_banner)
self.interact = <bound method TerminalInteractiveShell.interact ...nteractiveshell.TerminalInteractiveShell object>>
display_banner = None
437 #self.interact_with_readline()
438 # XXX for testing of a readline-decoupled repl loop, call
439 # interact_with_readline above
440 break

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.py in interact(self=<IPython.terminal.interactiveshell.TerminalInteractiveShell object>, display_banner=False)
550 if (self.SyntaxTB.last_syntax_error and
551 self.autoedit_syntax):
552 self.edit_syntax_error()
553 if not more:
554 source_raw = self.input_splitter.source_raw_reset()[1]
--> 555 self.run_cell(source_raw, store_history=True)
self.run_cell = <bound method TerminalInteractiveShell.run_cell ...nteractiveshell.TerminalInteractiveShell object>>
source_raw = u'run preprocess.py\n'
556 hlen_b4_cell =
557 self._replace_rlhist_multiline(source_raw, hlen_b4_cell)
558
559 # Turn off the exit flag, so the mainloop can be restarted if desired

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py in run_cell(self=<IPython.terminal.interactiveshell.TerminalInteractiveShell object>, raw_cell=u'run preprocess.py\n', store_history=True, silent=False, shell_futures=True)
2655
2656 code_ast = self.transform_ast(code_ast)
2657
2658 interactivity = "none" if silent else self.ast_node_interactivity
2659 self.run_ast_nodes(code_ast.body, cell_name,
-> 2660 interactivity=interactivity, compiler=compiler)
interactivity = 'last_expr'
compiler = <IPython.core.compilerop.CachingCompiler instance>
2661
2662 # Execute any registered post-execution functions.
2663 # unless we are silent
2664 post_exec = [] if silent else self._post_execute.iteritems()

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py in run_ast_nodes(self=<IPython.terminal.interactiveshell.TerminalInteractiveShell object>, nodelist=[<_ast.Expr object>], cell_name='', interactivity='last', compiler=<IPython.core.compilerop.CachingCompiler instance>)
2765 return True
2766
2767 for i, node in enumerate(to_run_interactive):
2768 mod = ast.Interactive([node])
2769 code = compiler(mod, cell_name, "single")
-> 2770 if self.run_code(code):
self.run_code = <bound method TerminalInteractiveShell.run_code ...nteractiveshell.TerminalInteractiveShell object>>
code = <code object at 0x7f5363f280b0, file "", line 1>
2771 return True
2772
2773 # Flush softspace
2774 if softspace(sys.stdout, 0):

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py in run_code(self=<IPython.terminal.interactiveshell.TerminalInteractiveShell object>, code_obj=<code object at 0x7f5363f280b0, file "", line 1>)
2815 outflag = 1 # happens in more places, so it's easier as default
2816 try:
2817 try:
2818 self.hooks.pre_run_code_hook()
2819 #rprint('Running code', repr(code_obj)) # dbg
-> 2820 exec code_obj in self.user_global_ns, self.user_ns
code_obj = <code object at 0x7f5363f280b0, file "", line 1>
self.user_global_ns = {'BASE_DIR': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'In': ['', u"get_ipython().magic(u'run preprocess.py')", u"get_ipython().magic(u'run preprocess.py')", u'import nibabel', u'nibabel.version', u"get_ipython().magic(u'run preprocess.py')", u"get_ipython().magic(u'run preprocess.py')", u"get_ipython().magic(u'run preprocess.py')"], 'Out': {4: '1.3.0'}, '': '1.3.0', '4': '1.3.0', '': '', '': '', 'builtin': <module 'builtin' (built-in)>, 'builtins': <module 'builtin' (built-in)>, 'doc': 'Automatically created module for IPython interactive environment', ...}
self.user_ns = {'BASE_DIR': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'In': ['', u"get_ipython().magic(u'run preprocess.py')", u"get_ipython().magic(u'run preprocess.py')", u'import nibabel', u'nibabel.version', u"get_ipython().magic(u'run preprocess.py')", u"get_ipython().magic(u'run preprocess.py')", u"get_ipython().magic(u'run preprocess.py')"], 'Out': {4: '1.3.0'}, '
': '1.3.0', '4': '1.3.0', '': '', '': '', 'builtin': <module 'builtin' (built-in)>, 'builtins': <module 'builtin' (built-in)>, 'doc': 'Automatically created module for IPython interactive environment', ...}
2821 finally:
2822 # Reset our crash handler in place
2823 sys.excepthook = old_excepthook
2824 except SystemExit:

...........................................................................
/volatile/darya/Documents/experiments/preprocessing_adnidod/ in ()
----> 1
2
3
4
5
6 get_ipython().magic(u'run preprocess.py')
7
8
9
10

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py in magic(self=<IPython.terminal.interactiveshell.TerminalInteractiveShell object>, arg_s=u'run preprocess.py')
2160 compound statements.
2161 """
2162 # TODO: should we issue a loud deprecation warning here?
2163 magic_name, _, magic_arg_s = arg_s.partition(' ')
2164 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2165 return self.run_line_magic(magic_name, magic_arg_s)
self.run_line_magic = >
magic_name = u'run'
magic_arg_s = u'preprocess.py'
2166
2167 #-------------------------------------------------------------------------
2168 # Things related to macros
2169 #-------------------------------------------------------------------------

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py in run_line_magic(self=<IPython.terminal.interactiveshell.TerminalInteractiveShell object>, magic_name=u'run', line=u'preprocess.py')
2081 kwargs = {}
2082 # Grab local namespace if we need it:
2083 if getattr(fn, "needs_local_scope", False):
2084 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2085 with self.builtin_trap:
-> 2086 result = fn(args,*kwargs)
result = undefined
fn = <bound method ExecutionMagics.run of <IPython.core.magics.execution.ExecutionMagics object>>
args = [u'preprocess.py']
kwargs = {}
2087 return result
2088
2089 def run_cell_magic(self, magic_name, line, cell):
2090 """Execute the given cell magic.

...........................................................................
/volatile/darya/Documents/experiments/preprocessing_adnidod/ in run(self=<IPython.core.magics.execution.ExecutionMagics object>, parameter_s=u'preprocess.py', runner=None, file_finder=)
1
----> 2
3
4
5 # -- coding: utf-8 --
6 """Implementation of execution-related magic functions.
7 """
8 #-----------------------------------------------------------------------------
9 # Copyright (c) 2012 The IPython Development Team.
10 #
11 # Distributed under the terms of the Modified BSD License.
12 #
13 # The full license is in the file COPYING.txt, distributed with this software.
14 #-----------------------------------------------------------------------------

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/core/magic.py in (f=, _a=(<IPython.core.magics.execution.ExecutionMagics object>, u'preprocess.py', None, ), *_k={})
186 validate_type(magic_kind)
187
188 # This is a closure to capture the magic_kind. We could also use a class,
189 # but it's overkill for just that one bit of state.
190 def magic_deco(arg):
--> 191 call = lambda f, _a, *_k: f(_a, *_k)
f =
a = (<IPython.core.magics.execution.ExecutionMagics object>, u'preprocess.py', None, )
k = {}
192
193 if callable(arg):
194 # "Naked" decorator call (just @foo, no args)
195 func = arg

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/core/magics/execution.py in run(self=<IPython.core.magics.execution.ExecutionMagics object>, parameter_s=u'preprocess.py', runner=>, file_finder=)
632 except (KeyError):
633 nruns = 1
634 self._run_with_timing(run, nruns)
635 else:
636 # regular execution
--> 637 run()
run =
638
639 if 'i' in opts:
640 self.shell.user_ns['name'] = __name__save
641 else:

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/core/magics/execution.py in run()
618 if runner is None:
619 runner = self.shell.safe_execfile
620
621 def run():
622 runner(filename, prog_ns, prog_ns,
--> 623 exit_ignore=exit_ignore)
624
625 if 't' in opts:
626 # timed execution
627 try:

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py in safe_execfile(self=<IPython.terminal.interactiveshell.TerminalInteractiveShell object>, fname=u'/volatile/darya/Documents/experiments/preprocessing_adnidod/preprocess.py', _where=({'BASE_DIR': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'builtins': {'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException': <type 'exceptions.BaseException'>, 'BufferError': <type 'exceptions.BufferError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, ...}, 'file': u'preprocess.py', 'name': 'main', 'nonzero': <function >, 'package': None, 'do_subjects_preproc': , 'fetch_spm_auditory': , 'generate_subject_stats_report': , 'jobfile': 'adnidod_config.ini', ...}, {'BASE_DIR': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'builtins': {'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException': <type 'exceptions.BaseException'>, 'BufferError': <type 'exceptions.BufferError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, ...}, 'file': u'preprocess.py', 'name': 'main', 'nonzero': <function >, 'package': None, 'do_subjects_preproc': , 'fetch_spm_auditory': , 'generate_subject_stats_report': , 'jobfile': 'adnidod_config.ini', ...}), *_kw={'exit_ignore': False, 'raise_exceptions': False})
2485 # Python inserts the script's directory into sys.path
2486 dname = os.path.dirname(fname)
2487
2488 with prepended_to_syspath(dname):
2489 try:
-> 2490 py3compat.execfile(fname,*where)
fname = u'/volatile/darya/Documents/experiments/preprocessing_adnidod/preprocess.py'
where = ({'BASE_DIR': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'builtins': {'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException': <type 'exceptions.BaseException'>, 'BufferError': <type 'exceptions.BufferError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, ...}, 'file': u'preprocess.py', 'name': 'main', 'nonzero': <function >, 'package': None, 'do_subjects_preproc': , 'fetch_spm_auditory': , 'generate_subject_stats_report': , 'jobfile': 'adnidod_config.ini', ...}, {'BASE_DIR': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'builtins': {'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException': <type 'exceptions.BaseException'>, 'BufferError': <type 'exceptions.BufferError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, ...}, 'file': u'preprocess.py', 'name': 'main', 'nonzero': <function >, 'package': None, 'do_subjects_preproc': , 'fetch_spm_auditory': , 'generate_subject_stats_report': , 'jobfile': 'adnidod_config.ini', ...})
2491 except SystemExit as status:
2492 # If the call was made with 0 or None exit status (sys.exit(0)
2493 # or sys.exit() ), don't bother showing a traceback, as both of
2494 # these are considered normal by the OS:

...........................................................................
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.py in execfile(fname=u'/volatile/darya/Documents/experiments/preprocessing_adnidod/preprocess.py', *where=({'BASE_DIR': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'builtins': {'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException': <type 'exceptions.BaseException'>, 'BufferError': <type 'exceptions.BufferError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, ...}, 'file': u'preprocess.py', 'name': 'main', 'nonzero': <function >, 'package': None, 'do_subjects_preproc': , 'fetch_spm_auditory': , 'generate_subject_stats_report': , 'jobfile': 'adnidod_config.ini', ...}, {'BASE_DIR': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'builtins': {'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException': <type 'exceptions.BaseException'>, 'BufferError': <type 'exceptions.BufferError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, ...}, 'file': u'preprocess.py', 'name': 'main', 'nonzero': <function >, 'package': None, 'do_subjects_preproc': , 'fetch_spm_auditory': , 'generate_subject_stats_report': , 'jobfile': 'adnidod_config.ini', ...}))
199 def execfile(fname, *where):
200 if isinstance(fname, unicode):
201 filename = fname.encode(sys.getfilesystemencoding())
202 else:
203 filename = fname
--> 204 builtin.execfile(filename, *where)
filename = '/volatile/darya/Documents/experiments/preprocessing_adnidod/preprocess.py'
where = ({'BASE_DIR': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'builtins': {'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException': <type 'exceptions.BaseException'>, 'BufferError': <type 'exceptions.BufferError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, ...}, 'file': u'preprocess.py', 'name': 'main', 'nonzero': <function >, 'package': None, 'do_subjects_preproc': , 'fetch_spm_auditory': , 'generate_subject_stats_report': , 'jobfile': 'adnidod_config.ini', ...}, {'BASE_DIR': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'builtins': {'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException': <type 'exceptions.BaseException'>, 'BufferError': <type 'exceptions.BufferError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, ...}, 'file': u'preprocess.py', 'name': 'main', 'nonzero': <function >, 'package': None, 'do_subjects_preproc': , 'fetch_spm_auditory': , 'generate_subject_stats_report': , 'jobfile': 'adnidod_config.ini', ...})
205
206
207
208

...........................................................................
/volatile/darya/Documents/experiments/preprocessing_adnidod/preprocess.py in ()
26 # directory that contains the files
27 BASE_DIR = '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj'
28 jobfile = 'adnidod_config.ini' #("")
29
30 # preprocess the data
---> 31 results = do_subjects_preproc(jobfile, dataset_dir=BASE_DIR)
32
33
34
35

...........................................................................
/volatile/darya/.local/lib/python2.7/site-packages/pypreprocess/nipype_preproc_spm_utils.py in do_subjects_preproc(subject_factory=[{'onset': [None], 'anat': '/volatile/darya/Docum...ipype_results': {}, 'warpable': ['anat', 'func']}, {'onset': [None], 'anat': '/volatile/darya/Docum...ipype_results': {}, 'warpable': ['anat', 'func']}], session_ids=None, *_preproc_params={'TA': 'TR * (1 - 1 / nslices)', 'TR': 3.0, 'anat_write_voxel_sizes': [1.0, 1.0, 1.0], 'caching': True, 'coreg_anat_to_func': False, 'coregister': True, 'coregister_reslice': False, 'coregister_software': 'spm', 'dartel': False, 'dataset_description': '\n

This ADNIDOD resting-state fMRI study includ...x 3 mm\n

  • Shape : 64 x 64 x 48
  • \n\n', ...})
    1709 if k in preproc_params:
    1710 backup_params[k] = preproc_params.pop(k)
    1711
    1712 # run classic preproc
    1713 subjects = Parallel(n_jobs=n_jobs)(delayed(do_subject_preproc)(
    -> 1714 subject_data, *_preproc_params) for subject_data in subjects)
    subject_data = {'onset': [None], 'anat': '/volatile/darya/Docum...ipype_results': {}, 'warpable': ['anat', 'func']}
    preproc_params = {'TA': 'TR * (1 - 1 / nslices)', 'TR': 3.0, 'anat_write_voxel_sizes': [1.0, 1.0, 1.0], 'caching': True, 'coreg_anat_to_func': False, 'coregister': True, 'coregister_reslice': False, 'coregister_software': 'spm', 'dartel': False, 'dataset_description': '\n

    This ADNIDOD resting-state fMRI study includ...x 3 mm\n

  • Shape : 64 x 64 x 48
  • \n\n', ...}
    subjects = [{'onset': [None], 'anat': '/volatile/darya/Docum...ipype_results': {}, 'warpable': ['anat', 'func']}, {'onset': [None], 'anat': '/volatile/darya/Docum...ipype_results': {}, 'warpable': ['anat', 'func']}]
    1715
    1716 # run DARTEL
    1717 preproc_params.update(backup_params)
    1718 if newsegment:

    ...........................................................................
    /usr/lib/python2.7/dist-packages/joblib/parallel.py in call(self=Parallel(n_jobs=2), iterable=<generator object >)
    655 if pre_dispatch == "all" or n_jobs == 1:
    656 # The iterable was consumed all at once by the above for loop.
    657 # No need to wait for async callbacks to trigger to
    658 # consumption.
    659 self._iterating = False
    --> 660 self.retrieve()
    self.retrieve = <bound method Parallel.retrieve of Parallel(n_jobs=2)>
    661 # Make sure that we get a last message telling us we are done
    662 elapsed_time = time.time() - self._start_time
    663 self._print('Done %3i out of %3i | elapsed: %s finished',
    664 (len(self._output),

    ---------------------------------------------------------------------------
    Sub-process traceback:
    ---------------------------------------------------------------------------
    AttributeError                                     Tue Aug  9 10:41:06 2016
    

    PID: 11724 Python 2.7.6: /usr/bin/python
    ...........................................................................
    /volatile/darya/.local/lib/python2.7/site-packages/pypreprocess/nipype_preproc_spm_utils.pyc in do_subject_preproc(subject_data={'onset': [None], 'anat': '/volatile/darya/Docum...ipype_results': {}, 'warpable': ['anat', 'func']}, deleteorient=True, slice_timing=True, slice_order='ascending', interleaved=True, ref_slice=1, TR=3.0, TA='TR * (1 - 1 / nslices)', slice_timing_software='spm', realign=True, realign_reslice=False, register_to_mean=True, realign_software='spm', coregister=True, coregister_reslice=False, coreg_anat_to_func=False, coregister_software='spm', segment=True, normalize=True, dartel=False, fwhm=0.0, anat_fwhm=0.0, func_write_voxel_sizes=[3.0, 3.0, 3.0], anat_write_voxel_sizes=[1.0, 1.0, 1.0], smooth_software='spm', hardlink_output=True, report=True, tsdiffana=True, parent_results_gallery=<pypreprocess.reporting.base_reporter.ResultsGallery object>, last_stage=True, preproc_undergone=None, prepreproc_undergone='', caching=True, **kwargs={'dataset_description': '\n

    This ADNIDOD resting-state fMRI study includ...x 3 mm\n

  • Shape : 64 x 64 x 48
  • \n\n', 'dataset_dir': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'dataset_id': '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj', 'matlab_exec': None, 'newsegment': False, 'output_modulated_tpms': False, 'spm_dir': None})
    1224 else:
    1225 assert isinstance(subject_data, SubjectData), (
    1226 "subject_datta must be SubjectData instance or dict, "
    1227 "got %s" % type(subject_data))
    1228
    -> 1229 subject_data.sanitize(deleteorient=deleteorient, niigz2nii=True)
    1230 subject_data.failed = False
    1231
    1232 # use EPI template for anat if anat is None
    1233 if subject_data.anat is None:

    ...........................................................................
    /volatile/darya/.local/lib/python2.7/site-packages/pypreprocess/subject_data.pyc in sanitize(self={'onset': [None], 'anat': '/volatile/darya/Docum...ipype_results': {}, 'warpable': ['anat', 'func']}, deleteorient=True, niigz2nii=True)
    388 # .dcm, .ima -> .nii
    389 self._dcm2nii()
    390
    391 # delete orientation meta-data
    392 if deleteorient:
    --> 393 self._delete_orientation()
    394
    395 # .nii.gz -> .nii extraction for SPM & co.
    396 if niigz2nii:
    397 self._niigz2nii()

    ...........................................................................
    /volatile/darya/.local/lib/python2.7/site-packages/pypreprocess/subject_data.pyc in _delete_orientation(self={'onset': [None], 'anat': '/volatile/darya/Docum...ipype_results': {}, 'warpable': ['anat', 'func']})
    167 warnings.warn("'%s' attribute of is None! Skipping" % attr)
    168 break
    169 else:
    170 self.func = [mem.cache(delete_orientation)(
    171 self.func[sess], self.session_output_dirs[sess])
    --> 172 for sess in range(self.n_sessions)]
    173
    174 # deleteorient for anat
    175 if self.anat is not None:
    176 self.anat = mem.cache(delete_orientation)(

    ...........................................................................
    /usr/lib/python2.7/dist-packages/joblib/memory.pyc in call(self=MemorizedFunc(func=<function delete_orientation ...od/data_2_subj_results/0003107/cache_dir/joblib'), *args=('/volatile/darya/Documents/experiments/preprocess...br_raw_20130927141408560_4967_S199091_I387201.nii', '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj_results/0003107/func'), **kwargs={})
    476 return MemorizedResult(self.cachedir, self.func, argument_hash,
    477 metadata=metadata, verbose=self._verbose - 1,
    478 timestamp=self.timestamp)
    479
    480 def call(self, *args, **kwargs):
    --> 481 return self._cached_call(args, kwargs)[0]
    482
    483 def reduce(self):
    484 """ We don't store the timestamp when pickling, to avoid the hash
    485 depending from it.

    ...........................................................................
    /usr/lib/python2.7/dist-packages/joblib/memory.pyc in _cached_call(self=MemorizedFunc(func=<function delete_orientation ...od/data_2_subj_results/0003107/cache_dir/joblib'), args=('/volatile/darya/Documents/experiments/preprocess...br_raw_20130927141408560_4967_S199091_I387201.nii', '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj_results/0003107/func'), kwargs={})
    423 if self._verbose > 10:
    424 _, name = get_func_name(self.func)
    425 self.warn('Computing func %s, argument hash %s in '
    426 'directory %s'
    427 % (name, argument_hash, output_dir))
    --> 428 out, metadata = self.call(_args, *_kwargs)
    429 if self.mmap_mode is not None:
    430 # Memmap the output at the first call to be consistent with
    431 # later calls
    432 out = _load_output(output_dir, _get_func_fullname(self.func),

    ...........................................................................
    /usr/lib/python2.7/dist-packages/joblib/memory.pyc in call(self=MemorizedFunc(func=<function delete_orientation ...od/data_2_subj_results/0003107/cache_dir/joblib'), *args=('/volatile/darya/Documents/experiments/preprocess...br_raw_20130927141408560_4967_S199091_I387201.nii', '/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj_results/0003107/func'), **kwargs={})
    668 """
    669 start_time = time.time()
    670 output_dir, _ = self._get_output_dir(*args, **kwargs)
    671 if self._verbose > 0:
    672 print(format_call(self.func, args, kwargs))
    --> 673 output = self.func(_args, *_kwargs)
    674 self._persist_output(output, output_dir)
    675 duration = time.time() - start_time
    676 metadata = self._persist_input(output_dir, duration, args, kwargs)
    677

    ...........................................................................
    /volatile/darya/.local/lib/python2.7/site-packages/pypreprocess/io_utils.pyc in delete_orientation(imgs=['/volatile/darya/Documents/experiments/preprocess...br_raw_20130927141408560_4967_S199091_I387201.nii'], output_dir='/volatile/darya/Documents/experiments/preprocessing_adnidod/data_2_subj_results/0003107/func', output_tag='')
    329 output_img = os.path.join(output_dir,
    330 output_tag + os.path.basename(img))
    331 new_img = nibabel.load(img)
    332 new_img.set_sform(np.zeros((4, 4)))
    333 new_img.set_qform(np.eye(4))
    --> 334 new_img.header['dim_info'] = 0
    335 nibabel.save(new_img, output_img)
    336 output_imgs.append(output_img)
    337
    338 if not_list:

    AttributeError: 'Nifti1Image' object has no attribute 'header'


    @AlexandreAbraham
    Copy link
    Contributor

    This is very weird. Can you run this in your terminal?

    python -c 'import nibabel; print(nibabel.__version__)'

    @mrahim
    Copy link
    Collaborator

    mrahim commented Aug 9, 2016

    1.3.0

    @AlexandreAbraham
    Copy link
    Contributor

    In version 1.3, the header is img._header and not img.header.

    A safe workaround is to use img.get_header().

    @dohmatob
    Copy link
    Contributor

    dohmatob commented Aug 9, 2016

    +1. Somebody wants to take on this ?

    On Tue, Aug 9, 2016 at 11:14 AM, Alexandre Abraham <[email protected]

    wrote:

    In version 1.3, the header is img._header and not img.header.

    A safe workaround is to use img.get_header().


    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #246 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AAms1IVPh0ngw84k_gd1GOa0iH_E0Wnbks5qeETagaJpZM4Jf3HJ
    .

    Elvis Dohmatob,
    sent from my potato...
    http://dohmatob.blogspot.fr/, https://team.inria.fr/parietal/elvis/,
    https://github.com/dohmatob

    @dohmatob
    Copy link
    Contributor

    dohmatob commented Aug 9, 2016

    The deletete_orientation function has to be rewritten from scratch. It
    looks horrible, and can break in a 1000 different ways.

    On Tue, Aug 9, 2016 at 11:15 AM, Elvis Dohmatob [email protected] wrote:

    +1. Somebody wants to take on this ?

    On Tue, Aug 9, 2016 at 11:14 AM, Alexandre Abraham <
    [email protected]> wrote:

    In version 1.3, the header is img._header and not img.header.

    A safe workaround is to use img.get_header().


    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #246 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AAms1IVPh0ngw84k_gd1GOa0iH_E0Wnbks5qeETagaJpZM4Jf3HJ
    .

    Elvis Dohmatob,
    sent from my potato...
    http://dohmatob.blogspot.fr/, https://team.inria.fr/parietal/elvis/,
    https://github.com/dohmatob

    Elvis Dohmatob,
    sent from my potato...
    http://dohmatob.blogspot.fr/, https://team.inria.fr/parietal/elvis/,
    https://github.com/dohmatob

    @AlexandreAbraham
    Copy link
    Contributor

    #ResearchCode

    @AlexandreAbraham
    Copy link
    Contributor

    @dohmatob the function does not seem that bad to me... Can you be more precise?

    @dohmatob
    Copy link
    Contributor

    dohmatob commented Aug 9, 2016

    Mainly design issues.

    • We want to work with more general nifti-likes as input
    • Obligatory output_dir arg seems a bad idea
    • other stuff ?
      Basically, the function should simply delete the orientation meta data and
      return the output image. The whole output file logic should ideally be
      removed.

    N.B.: I understand that who ever implemented this function inherited from a
    very bad code base from me.

    On Tue, Aug 9, 2016 at 11:32 AM, Alexandre Abraham <[email protected]

    wrote:

    @dohmatob https://github.com/dohmatob the function does not seem that
    bad to me... Can you be more precise?


    You are receiving this because you were mentioned.
    Reply to this email directly, view it on GitHub
    #246 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AAms1NkRozaK374EpMtI3m3K1FKvG1spks5qeEkRgaJpZM4Jf3HJ
    .

    Elvis Dohmatob,
    sent from my potato...
    http://dohmatob.blogspot.fr/, https://team.inria.fr/parietal/elvis/,
    https://github.com/dohmatob

    @mrahim mrahim reopened this Jan 17, 2017
    @AlexandreAbraham
    Copy link
    Contributor

    The neverending issue!

    @darya-chyzhyk
    Copy link
    Author

    darya-chyzhyk commented Jan 17, 2017

    The error appear when using delete orientation option

    Should orientation meta-date be stripped-off image headers ?
    deleteorient = True

     Executing node d703e8c3dea596ceef853fee8927d1f3 in dir: /home/darya/Documents/Inria/data/ADNIDOD_example/results/0006315/cache_dir/nipype_mem/nipype-interfaces-spm-preprocess-Realign/d703e8c3dea596ceef853fee8927d1f3
    

    Traceback (most recent call last):
    File "preprocess_example.py", line 49, in
    results = do_subjects_preproc(jobfile, dataset_dir=BASE_DIR)
    File "/home/darya/.local/lib/python2.7/site-packages/pypreprocess/nipype_preproc_spm_utils.py", line 1713, in do_subjects_preproc
    subject_data, **preproc_params) for subject_data in subjects)
    File "/home/darya/anaconda2/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.py", line 768, in call
    self.retrieve()
    File "/home/darya/anaconda2/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.py", line 719, in retrieve
    raise exception
    sklearn.externals.joblib.my_exceptions.JoblibRuntimeError: JoblibRuntimeError


    Multiprocessing exception:
    ...........................................................................
    /home/darya/Documents/github/adnidod_preprocess/preprocess_example.py in ()
    44 #jobfile = 'adnidod_config.ini' #("")
    45 #jobfile = 'audio_config.ini'
    46 jobfile = 'adnidod2016_config_example.ini'
    47
    48 # preprocess the data
    ---> 49 results = do_subjects_preproc(jobfile, dataset_dir=BASE_DIR)
    50
    51
    52
    53

    ...........................................................................
    /home/darya/.local/lib/python2.7/site-packages/pypreprocess/nipype_preproc_spm_utils.py in do_subjects_preproc(subject_factory=[{'drift_model': 'Cosine', 'scratch': '/home/dary...e/results/0003107', 'warpable': ['anat', 'func']}, {'drift_model': 'Cosine', 'scratch': '/home/dary...e/results/0006315', 'warpable': ['anat', 'func']}], session_ids=None, **preproc_params={'TA': 'TR * (1 - 1 / nslices)', 'TR': 3.0, 'anat_write_voxel_sizes': [1.0, 1.0, 1.0], 'caching': True, 'coreg_anat_to_func': False, 'coregister': True, 'coregister_reslice': False, 'coregister_software': 'spm', 'dartel': False, 'dataset_description': '\n

    This ADNIDOD resting-state fMRI study includ...x 3 mm\n

  • Shape : 64 x 64 x 48
  • \n\n', ...})
    1708 if k in preproc_params:
    1709 backup_params[k] = preproc_params.pop(k)
    1710
    1711 # run classic preproc
    1712 subjects = Parallel(n_jobs=n_jobs)(delayed(do_subject_preproc)(
    -> 1713 subject_data, **preproc_params) for subject_data in subjects)
    subject_data = {'drift_model': 'Cosine', 'scratch': '/home/dary...e/results/0006315', 'warpable': ['anat', 'func']}
    preproc_params = {'TA': 'TR * (1 - 1 / nslices)', 'TR': 3.0, 'anat_write_voxel_sizes': [1.0, 1.0, 1.0], 'caching': True, 'coreg_anat_to_func': False, 'coregister': True, 'coregister_reslice': False, 'coregister_software': 'spm', 'dartel': False, 'dataset_description': '\n

    This ADNIDOD resting-state fMRI study includ...x 3 mm\n

  • Shape : 64 x 64 x 48
  • \n\n', ...}
    subjects = [{'drift_model': 'Cosine', 'scratch': '/home/dary...e/results/0003107', 'warpable': ['anat', 'func']}, {'drift_model': 'Cosine', 'scratch': '/home/dary...e/results/0006315', 'warpable': ['anat', 'func']}]
    1714
    1715 # run DARTEL
    1716 preproc_params.update(backup_params)
    1717 if newsegment:

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.py in call(self=Parallel(n_jobs=2), iterable=<generator object >)
    763 if pre_dispatch == "all" or n_jobs == 1:
    764 # The iterable was consumed all at once by the above for loop.
    765 # No need to wait for async callbacks to trigger to
    766 # consumption.
    767 self._iterating = False
    --> 768 self.retrieve()
    self.retrieve = <bound method Parallel.retrieve of Parallel(n_jobs=2)>
    769 # Make sure that we get a last message telling us we are done
    770 elapsed_time = time.time() - self._start_time
    771 self._print('Done %3i out of %3i | elapsed: %s finished',
    772 (len(self._output), len(self._output),

    Sub-process traceback:

    RuntimeError Tue Jan 17 11:29:32 2017
    PID: 17303 Python 2.7.12: /home/darya/anaconda2/bin/python
    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.py in call(self=<sklearn.externals.joblib.parallel.BatchedCalls object>)
    126 def init(self, iterator_slice):
    127 self.items = list(iterator_slice)
    128 self._size = len(self.items)
    129
    130 def call(self):
    --> 131 return [func(*args, **kwargs) for func, args, kwargs in self.items]
    func =
    args = ({'report_preproc_filename': '/home/darya/Documen...9091_I387201.nii'], 'warpable': ['anat', 'func']},)
    kwargs = {'TA': 'TR * (1 - 1 / nslices)', 'TR': 3.0, 'anat_write_voxel_sizes': [1.0, 1.0, 1.0], 'caching': True, 'coreg_anat_to_func': False, 'coregister': True, 'coregister_reslice': False, 'coregister_software': 'spm', 'dartel': False, 'dataset_description': '\n

    This ADNIDOD resting-state fMRI study includ...x 3 mm\n

  • Shape : 64 x 64 x 48
  • \n\n', ...}
    self.items = [(, ({'report_preproc_filename': '/home/darya/Documen...9091_I387201.nii'], 'warpable': ['anat', 'func']},), {'TA': 'TR * (1 - 1 / nslices)', 'TR': 3.0, 'anat_write_voxel_sizes': [1.0, 1.0, 1.0], 'caching': True, 'coreg_anat_to_func': False, 'coregister': True, 'coregister_reslice': False, 'coregister_software': 'spm', 'dartel': False, 'dataset_description': '\n

    This ADNIDOD resting-state fMRI study includ...x 3 mm\n

  • Shape : 64 x 64 x 48
  • \n\n', ...})]
    132
    133 def len(self):
    134 return self._size
    135

    ...........................................................................
    /home/darya/.local/lib/python2.7/site-packages/pypreprocess/nipype_preproc_spm_utils.py in do_subject_preproc(subject_data={'report_preproc_filename': '/home/darya/Documen...9091_I387201.nii'], 'warpable': ['anat', 'func']}, deleteorient=True, slice_timing=True, slice_order='ascending', interleaved=True, ref_slice=1, TR=3.0, TA='TR * (1 - 1 / nslices)', slice_timing_software='spm', realign=True, realign_reslice=False, register_to_mean=True, realign_software='spm', coregister=True, coregister_reslice=False, coreg_anat_to_func=False, coregister_software='spm', segment=True, normalize=True, dartel=False, fwhm=[0.0, 0.0, 0.0], anat_fwhm=[0.0, 0.0, 0.0], func_write_voxel_sizes=[3.0, 3.0, 3.0], anat_write_voxel_sizes=[1.0, 1.0, 1.0], smooth_software='spm', hardlink_output=True, report=True, tsdiffana=True, parent_results_gallery=<pypreprocess.reporting.base_reporter.ResultsGallery object>, last_stage=True, preproc_undergone='

    All preprocessing was done using <a href="htt... been applied to the functional images.', prepreproc_undergone='', caching=True, **kwargs={'dataset_description': '\n

    This ADNIDOD resting-state fMRI study includ...x 3 mm\n

  • Shape : 64 x 64 x 48
  • \n\n', 'dataset_dir': '/home/darya/Documents/Inria/data/ADNIDOD_example/data', 'dataset_id': '/home/darya/Documents/Inria/data/ADNIDOD_example/data', 'matlab_exec': None, 'newsegment': False, 'output_modulated_tpms': False, 'spm_dir': None})
    1292 subject_data, caching=caching,
    1293 reslice=realign_reslice,
    1294 register_to_mean=register_to_mean,
    1295 report=report,
    1296 hardlink_output=hardlink_output,
    -> 1297 software=realign_software
    realign_software = 'spm'
    1298 )
    1299
    1300 # handle failed node
    1301 if subject_data.failed:

    ...........................................................................
    /home/darya/.local/lib/python2.7/site-packages/pypreprocess/nipype_preproc_spm_utils.py in _do_subject_realign(subject_data={'report_preproc_filename': '/home/darya/Documen...9091_I387201.nii'], 'warpable': ['anat', 'func']}, reslice=False, register_to_mean=True, caching=True, report=True, software='spm', spm_dir=None, matlab_exec=None, spm_mcr=None, hardlink_output=True, **kwargs={})
    313 realign = spm.Realign().run
    314
    315 # run node
    316 realign_result = realign(
    317 in_files=subject_data.func, register_to_mean=register_to_mean,
    --> 318 jobtype=jobtype, **kwargs)
    jobtype = 'estwrite'
    kwargs = {}
    319
    320 # failed node
    321 if realign_result.outputs is None:
    322 subject_data.failed = True

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/nipype/caching/memory.py in call(self=PipeFunc(nipype.interfaces.spm.preprocess.Realig...DOD_example/results/0003107/cache_dir/nipype_mem), **kwargs={'in_files': ['/home/darya/Documents/Inria/data/ADNIDOD_example...br_raw_20130927141408560_4967_S199091_I387201.nii'], 'jobtype': 'estwrite', 'register_to_mean': True})
    81 node = Node(interface, name=job_name)
    82 node.base_dir = os.path.join(self.base_dir, dir_name)
    83
    84 cwd = os.getcwd()
    85 try:
    ---> 86 out = node.run()
    out = undefined
    node.run =
    87 finally:
    88 # node.run() changes to the node directory - if something goes wrong
    89 # before it cds back you would end up in strange places
    90 os.chdir(cwd)

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py in run(self=d67dadf29f94905cbe5dfc3508fe6568, updatehash=False)
    389 self.write_report(report_type='preexec', cwd=outdir)
    390 savepkl(op.join(outdir, '_node.pklz'), self)
    391 savepkl(op.join(outdir, '_inputs.pklz'),
    392 self.inputs.get_traitsfree())
    393 try:
    --> 394 self._run_interface()
    self._run_interface =
    395 except:
    396 os.remove(hashfile_unfinished)
    397 raise
    398 shutil.move(hashfile_unfinished, hashfile)

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py in _run_interface(self=d67dadf29f94905cbe5dfc3508fe6568, execute=True, updatehash=False)
    499 def _run_interface(self, execute=True, updatehash=False):
    500 if updatehash:
    501 return
    502 old_cwd = os.getcwd()
    503 os.chdir(self.output_dir())
    --> 504 self._result = self._run_command(execute)
    self._result = <nipype.interfaces.base.InterfaceResult object>
    self._run_command =
    execute = True
    505 os.chdir(old_cwd)
    506
    507 def save_results(self, result, cwd):
    508 resultsfile = op.join(cwd, 'result
    %s.pklz' % self.name)

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py in _run_command(self=d67dadf29f94905cbe5dfc3508fe6568, execute=True, copyfiles=True)
    625 fd = open(cmdfile, 'wt')
    626 fd.writelines(cmd + "\n")
    627 fd.close()
    628 logger.info('Running: %s' % cmd)
    629 try:
    --> 630 result = self._interface.run()
    result = <nipype.interfaces.base.InterfaceResult object>
    self._interface.run = <bound method Realign.run of <nipype.interfaces.spm.preprocess.Realign object>>
    631 except Exception as msg:
    632 self._result.runtime.stderr = msg
    633 raise
    634

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py in run(self=<nipype.interfaces.spm.preprocess.Realign object>, **inputs={'ignore_exception': False, 'in_files': ['/home/darya/Documents/Inria/data/ADNIDOD_example...br_raw_20130927141408560_4967_S199091_I387201.nii'], 'jobtype': 'estwrite', 'matlab_cmd': '/usr/local/bin/spm12 run script', 'mfile': True, 'out_prefix': 'r', 'register_to_mean': True, 'use_mcr': True, 'use_v8struct': True, 'write_which': [2, 1]})
    1038 endTime=None,
    1039 platform=platform.platform(),
    1040 hostname=getfqdn(),
    1041 version=self.version)
    1042 try:
    -> 1043 runtime = self._run_wrapper(runtime)
    runtime = Bunch(cwd='/home/darya/Documents/Inria/data/ADNI...e Realign failed to run. ',), version=u'12.6914')
    self._run_wrapper = <bound method Realign._run_wrapper of <nipype.interfaces.spm.preprocess.Realign object>>
    1044 outputs = self.aggregate_outputs(runtime)
    1045 runtime.endTime = dt.isoformat(dt.utcnow())
    1046 timediff = parseutc(runtime.endTime) - parseutc(runtime.startTime)
    1047 runtime.duration = (timediff.days * 86400 + timediff.seconds +

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py in _run_wrapper(self=<nipype.interfaces.spm.preprocess.Realign object>, runtime=Bunch(cwd='/home/darya/Documents/Inria/data/ADNI...e Realign failed to run. ',), version=u'12.6914'))
    995 vdisp_num = vdisp.vdisplay_num
    996
    997 iflogger.info('Redirecting X to :%d' % vdisp_num)
    998 runtime.environ['DISPLAY'] = ':%d' % vdisp_num
    999
    -> 1000 runtime = self._run_interface(runtime)
    runtime = Bunch(cwd='/home/darya/Documents/Inria/data/ADNI...e Realign failed to run. ',), version=u'12.6914')
    self._run_interface = <bound method Realign._run_interface of <nipype.interfaces.spm.preprocess.Realign object>>
    1001
    1002 if self._redirect_x:
    1003 vdisp.stop()
    1004

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/nipype/interfaces/spm/base.py in _run_interface(self=<nipype.interfaces.spm.preprocess.Realign object>, runtime=Bunch(cwd='/home/darya/Documents/Inria/data/ADNI...e Realign failed to run. ',), version=u'12.6914'))
    306
    307 def _run_interface(self, runtime):
    308 """Executes the SPM function using MATLAB."""
    309 self.mlab.inputs.script = self._make_matlab_command(
    310 deepcopy(self._parse_inputs()))
    --> 311 results = self.mlab.run()
    results = undefined
    self.mlab.run = <bound method MatlabCommand.run of <nipype.interfaces.matlab.MatlabCommand object>>
    312 runtime.returncode = results.runtime.returncode
    313 if self.mlab.inputs.uses_mcr:
    314 if 'Skipped' in results.runtime.stdout:
    315 self.raise_exception(runtime)

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py in run(self=<nipype.interfaces.matlab.MatlabCommand object>, **inputs={'environ': {}, 'ignore_exception': False, 'mfile': True, 'postscript': ['\n,catch ME,', r"fprintf(2,'MATLAB code threw an exception:\n');", r"fprintf(2,'%s\n',ME.message);", r"if length(ME.stack) ~= 0, fprintf(2,'File:%s\nNa...ME.stack.file,ME.stack.name,ME.stack.line);, end;", 'end;'], 'prescript': [r"fprintf(1,'Executing %s at %s:\n',mfilename(),datestr(now));", 'ver,', 'try,'], 'script': "\n %% Generated by nipype.interfaces.spm\n ... close('all', 'force');\n end;\n ", 'script_file': 'pyscript_realign.m', 'terminal_output': 'allatonce', 'uses_mcr': True})
    1038 endTime=None,
    1039 platform=platform.platform(),
    1040 hostname=getfqdn(),
    1041 version=self.version)
    1042 try:
    -> 1043 runtime = self._run_wrapper(runtime)
    runtime = Bunch(cmdline='/usr/local/bin/spm12 run script /...e MatlabCommand failed to run. ',), version=None)
    self._run_wrapper = <bound method MatlabCommand._run_wrapper of <nipype.interfaces.matlab.MatlabCommand object>>
    1044 outputs = self.aggregate_outputs(runtime)
    1045 runtime.endTime = dt.isoformat(dt.utcnow())
    1046 timediff = parseutc(runtime.endTime) - parseutc(runtime.startTime)
    1047 runtime.duration = (timediff.days * 86400 + timediff.seconds +

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py in _run_wrapper(self=<nipype.interfaces.matlab.MatlabCommand object>, runtime=Bunch(cmdline='/usr/local/bin/spm12 run script /...e MatlabCommand failed to run. ',), version=None))
    1655 )
    1656 o, e = proc.communicate()
    1657 return o
    1658
    1659 def _run_wrapper(self, runtime):
    -> 1660 runtime = self._run_interface(runtime)
    runtime = Bunch(cmdline='/usr/local/bin/spm12 run script /...e MatlabCommand failed to run. ',), version=None)
    self._run_interface = <bound method MatlabCommand._run_interface of <nipype.interfaces.matlab.MatlabCommand object>>
    1661 return runtime
    1662
    1663 def _run_interface(self, runtime, correct_return_codes=[0]):
    1664 """Execute command via subprocess

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/nipype/interfaces/matlab.py in _run_interface(self=<nipype.interfaces.matlab.MatlabCommand object>, runtime=Bunch(cmdline='/usr/local/bin/spm12 run script /...e MatlabCommand failed to run. ',), version=None))
    144 os.system('stty sane')
    145 except:
    146 # We might be on a system where stty doesn't exist
    147 pass
    148 if 'MATLAB code threw an exception' in runtime.stderr:
    --> 149 self.raise_exception(runtime)
    self.raise_exception = <bound method MatlabCommand.raise_exception of <nipype.interfaces.matlab.MatlabCommand object>>
    runtime = Bunch(cmdline='/usr/local/bin/spm12 run script /...e MatlabCommand failed to run. ',), version=None)
    150 return runtime
    151
    152 def _format_arg(self, name, trait_spec, value):
    153 if name in ['script']:

    ...........................................................................
    /home/darya/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py in raise_exception(self=<nipype.interfaces.matlab.MatlabCommand object>, runtime=Bunch(cmdline='/usr/local/bin/spm12 run script /...e MatlabCommand failed to run. ',), version=None))
    1613 def raise_exception(self, runtime):
    1614 message = "Command:\n" + runtime.cmdline + "\n"
    1615 message += "Standard output:\n" + runtime.stdout + "\n"
    1616 message += "Standard error:\n" + runtime.stderr + "\n"
    1617 message += "Return code: " + str(runtime.returncode)
    -> 1618 raise RuntimeError(message)
    message = u'Command:\n/usr/local/bin/spm12 run script /hom...TLABbatch system\n\nLine:\n0\n\n\nReturn code: 0'
    1619
    1620 @classmethod
    1621 def help(cls, returnhelp=False):
    1622 allhelp = super(CommandLine, cls).help(returnhelp=True)

    RuntimeError: Command:
    /usr/local/bin/spm12 run script /home/darya/Documents/Inria/data/ADNIDOD_example/results/0003107/cache_dir/nipype_mem/nipype-interfaces-spm-preprocess-Realign/d67dadf29f94905cbe5dfc3508fe6568/pyscript_realign.m
    Standard output:
    Warning: Unable to open display ':1'. You will not be able to display graphics on the screen.
    SPM12 (6914): /usr/local/src/spm12/spm12_mcr/spm12


    / )( _ ( / )
    _
    \ )
    / ) ( Statistical Parametric Mapping
    (
    /(_) (_//_) SPM12 - http://www.fil.ion.ucl.ac.uk/spm/

    Warning: Unknown extension: 'script'

    In spm_jobman>load_jobs at 334
    In spm_jobman at 143
    In spm_standalone at 33
    Warning: No batch job found in 'script'
    In spm_jobman>load_jobs at 343
    In spm_jobman at 143
    In spm_standalone at 33
    Execution failed: scriptExecuting spm_jobman at 17-Jan-2017 11:29:25:

    MATLAB Version 7.10.0.499 (R2010a)
    MATLAB License Number: unknown
    Operating System: Linux 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64
    Java VM Version: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode

    MATLAB Version 7.10 (R2010a)
    MATLAB Compiler Version 4.13 (R2010a)
    Signal Processing Toolbox Version 6.13 (R2010a)
    SPM version: SPM12 Release: 6914
    SPM path: /usr/local/src/spm12/spm12_mcr/spm12/spm.m

    Running job #1

    Running 'Realign: Estimate & Reslice'

    SPM12: spm_realign (v6070) 11:29:28 - 17/01/2017

    Failed 'Realign: Estimate & Reslice'
    Error using ==> colon
    Maximum variable size allowed by the program is exceeded.
    In file "/usr/local/src/spm12/spm12_mcr/spm12/spm_realign.m" (???), function "smooth_vol" at line 421.
    In file "/usr/local/src/spm12/spm12_mcr/spm12/spm_realign.m" (???), function "realign_series" at line 234.
    In file "/usr/local/src/spm12/spm12_mcr/spm12/spm_realign.m" (???), function "spm_realign" at line 136.
    In file "/usr/local/src/spm12/spm12_mcr/spm12/config/spm_run_realign.m" (???), function "spm_run_realign" at line 31.

    The following modules did not run:
    Failed: Realign: Estimate & Reslice

    Running job #2

    Running 'Realign: Estimate & Reslice'

    SPM12: spm_realign (v6070) 11:29:31 - 17/01/2017

    Failed 'Realign: Estimate & Reslice'
    Error using ==> colon
    Maximum variable size allowed by the program is exceeded.
    In file "/usr/local/src/spm12/spm12_mcr/spm12/spm_realign.m" (???), function "smooth_vol" at line 421.
    In file "/usr/local/src/spm12/spm12_mcr/spm12/spm_realign.m" (???), function "realign_series" at line 234.
    In file "/usr/local/src/spm12/spm12_mcr/spm12/spm_realign.m" (???), function "spm_realign" at line 136.
    In file "/usr/local/src/spm12/spm12_mcr/spm12/config/spm_run_realign.m" (???), function "spm_run_realign" at line 31.

    The following modules did not run:
    Failed: Realign: Estimate & Reslice

    Execution failed: /home/darya/Documents/Inria/data/ADNIDOD_example/results/0003107/cache_dir/nipype_mem/nipype-interfaces-spm-preprocess-Realign/d67dadf29f94905cbe5dfc3508fe6568/pyscript_realign.mBye for now...

    Standard error:
    MATLAB code threw an exception:
    Job execution failed. The full log of this run can be found in MATLAB command window, starting with the lines (look for the line showing the exact #job as displayed in this error message)

    Running job #1

    File:

    Name:
    MATLABbatch system

    Line:
    0

    Return code: 0
    Interface MatlabCommand failed to run.
    Interface Realign failed to run.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants