-
Notifications
You must be signed in to change notification settings - Fork 66
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
Comments
This is very weird. Can you run this in your terminal?
|
|
In version 1.3, the header is A safe workaround is to use |
+1. Somebody wants to take on this ? On Tue, Aug 9, 2016 at 11:14 AM, Alexandre Abraham <[email protected]
Elvis Dohmatob, |
The deletete_orientation function has to be rewritten from scratch. It On Tue, Aug 9, 2016 at 11:15 AM, Elvis Dohmatob [email protected] wrote:
Elvis Dohmatob, |
#ResearchCode |
@dohmatob the function does not seem that bad to me... Can you be more precise? |
Mainly design issues.
N.B.: I understand that who ever implemented this function inherited from a On Tue, Aug 9, 2016 at 11:32 AM, Alexandre Abraham <[email protected]
Elvis Dohmatob, |
The neverending issue! |
The error appear when using delete orientation option Should orientation meta-date be stripped-off image headers ?
Traceback (most recent call last): Multiprocessing exception: ........................................................................... This ADNIDOD resting-state fMRI study includ...x 3 mm\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 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: ........................................................................... Sub-process traceback: RuntimeError Tue Jan 17 11:29:32 2017 This ADNIDOD resting-state fMRI study includ...x 3 mm\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 132 133 def len(self): 134 return self._size 135 ........................................................................... 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 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: ........................................................................... ........................................................................... ........................................................................... ........................................................................... ........................................................................... ........................................................................... ........................................................................... ........................................................................... ........................................................................... ........................................................................... ........................................................................... ........................................................................... RuntimeError: Command: / )( _ ( / ) Warning: Unknown extension: 'script'
MATLAB Version 7.10.0.499 (R2010a) MATLAB Version 7.10 (R2010a) Running job #1 Running 'Realign: Estimate & Reslice' SPM12: spm_realign (v6070) 11:29:28 - 17/01/2017 Failed 'Realign: Estimate & Reslice' The following modules did not run: Running job #2 Running 'Realign: Estimate & Reslice' SPM12: spm_realign (v6070) 11:29:31 - 17/01/2017 Failed 'Realign: Estimate & Reslice' The following modules did not run: 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: Running job #1 File: Name: Line: Return code: 0 |
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
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
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),
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
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'
The text was updated successfully, but these errors were encountered: