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

Interface Normalize failed to run. #1900

Open
ankita940 opened this issue Mar 21, 2017 · 13 comments
Open

Interface Normalize failed to run. #1900

ankita940 opened this issue Mar 21, 2017 · 13 comments

Comments

@ankita940
Copy link

ankita940 commented Mar 21, 2017

Hello,
I am new to nipye, I am running a pipeline on fmri auditory dataset but its giving error on nomalization(using spm.Normalize()) .

thank you,

I am attaching the crash file produced -

File: crash-20170322-023831-ankita-normalize_struc.a0-074e2843-d6da-447a-b0ca-8b9b55c4527f.pklz
Node: level1.firstlevel.preproc.normalize_struc.a0
Working directory: /home/ankita/preprocess/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/normalize_struc


Node inputs:

DCT_period_cutoff = <undefined>
affine_regularization_type = <undefined>
apply_to_files = <undefined>
ignore_exception = False
jobtype = write
matlab_cmd = <undefined>
mfile = True
nonlinear_iterations = <undefined>
nonlinear_regularization = <undefined>
out_prefix = w
parameter_file = /home/ankita/preprocess/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/normalize_struc/sM00223_002_seg_sn.mat
paths = <undefined>
source = <undefined>
source_image_smoothing = <undefined>
source_weight = <undefined>
template = <undefined>
template_image_smoothing = <undefined>
template_weight = <undefined>
use_mcr = <undefined>
use_v8struct = True
write_bounding_box = <undefined>
write_interp = <undefined>
write_preserve = <undefined>
write_voxel_sizes = <undefined>
write_wrap = <undefined>



Traceback: 
Traceback (most recent call last):
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/pipeline/plugins/linear.py", line 43, in run
    node.run(updatehash=updatehash)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 366, in run
    self._run_interface()
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 476, in _run_interface
    self._result = self._run_command(execute)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 607, in _run_command
    result = self._interface.run()
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1085, in run
    runtime = self._run_wrapper(runtime)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1033, in _run_wrapper
    runtime = self._run_interface(runtime)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/spm/base.py", line 323, in _run_interface
    results = self.mlab.run()
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1085, in run
    runtime = self._run_wrapper(runtime)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1728, in _run_wrapper
    runtime = self._run_interface(runtime)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/matlab.py", line 152, in _run_interface
    self.raise_exception(runtime)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1686, in raise_exception
    **runtime.dictcopy()))
RuntimeError: Command:
matlab -nodesktop -nosplash -nodesktop -nosplash -singleCompThread -r "addpath('/home/ankita/preprocess/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/normalize_struc');pyscript_normalize;exit"
Standard output:
MATLAB is selecting SOFTWARE OPENGL rendering.

                            < M A T L A B (R) >
                  Copyright 1984-2016 The MathWorks, Inc.
                   R2016b (9.1.0.441655) 64-bit (glnxa64)
                             September 7, 2016

 
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
 
Executing pyscript_normalize at 22-Mar-2017 02:38:17:
----------------------------------------------------------------------------------------------------
MATLAB Version: 9.1.0.441655 (R2016b)
MATLAB License Number: 40480989
Operating System: Linux 3.16.0-60-generic #80~14.04.1-Ubuntu SMP Wed Jan 20 13:37:48 UTC 2016 x86_64
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB                                                Version 9.1         (R2016b)
Simulink                                              Version 8.8         (R2016b)
Antenna Toolbox                                       Version 2.1         (R2016b)
Audio System Toolbox                                  Version 1.1         (R2016b)
Bioinformatics Toolbox                                Version 4.7         (R2016b)
Communications System Toolbox                         Version 6.3         (R2016b)
Computer Vision System Toolbox                        Version 7.2         (R2016b)
Control System Toolbox                                Version 10.1        (R2016b)
Curve Fitting Toolbox                                 Version 3.5.4       (R2016b)
DSP System Toolbox                                    Version 9.3         (R2016b)
Database Toolbox                                      Version 7.0         (R2016b)
Embedded Coder                                        Version 6.11        (R2016b)
Filter Design HDL Coder                               Version 3.1         (R2016b)
Fixed-Point Designer                                  Version 5.3         (R2016b)
Fuzzy Logic Toolbox                                   Version 2.2.24      (R2016b)
Global Optimization Toolbox                           Version 3.4.1       (R2016b)
HDL Coder                                             Version 3.9         (R2016b)
HDL Verifier                                          Version 5.1         (R2016b)
Image Acquisition Toolbox                             Version 5.1         (R2016b)
Image Processing Toolbox                              Version 9.5         (R2016b)
Instrument Control Toolbox                            Version 3.10        (R2016b)
LTE System Toolbox                                    Version 2.3         (R2016b)
MATLAB Coder                                          Version 3.2         (R2016b)
MATLAB Report Generator                               Version 5.1         (R2016b)
Mapping Toolbox                                       Version 4.4         (R2016b)
Model Predictive Control Toolbox                      Version 5.2.1       (R2016b)
Neural Network Toolbox                                Version 9.1         (R2016b)
Optimization Toolbox                                  Version 7.5         (R2016b)
Parallel Computing Toolbox                            Version 6.9         (R2016b)
Partial Differential Equation Toolbox                 Version 2.3         (R2016b)
Phased Array System Toolbox                           Version 3.3         (R2016b)
RF Toolbox                                            Version 3.1         (R2016b)
Robotics System Toolbox                               Version 1.3         (R2016b)
Robust Control Toolbox                                Version 6.2         (R2016b)
Signal Processing Toolbox                             Version 7.3         (R2016b)
SimRF                                                 Version 5.1         (R2016b)
Simscape                                              Version 4.1         (R2016b)
Simscape Driveline                                    Version 2.11        (R2016b)
Simscape Electronics                                  Version 2.10        (R2016b)
Simscape Multibody                                    Version 4.9         (R2016b)
Simulink 3D Animation                                 Version 7.6         (R2016b)
Simulink Control Design                               Version 4.4         (R2016b)
Stateflow                                             Version 8.8         (R2016b)
Statistical Parametric Mapping                        Version 6906        (SPM12) 
Statistics and Machine Learning Toolbox               Version 11.0        (R2016b)
Symbolic Math Toolbox                                 Version 7.1         (R2016b)
System Identification Toolbox                         Version 9.5         (R2016b)
WLAN System Toolbox                                   Version 1.2         (R2016b)
Wavelet Toolbox                                       Version 4.17        (R2016b)
SPM version: SPM12 Release: 6906
SPM path: /usr/local/MATLAB/R2016b/toolbox/spm12/spm.m
Conversion Normalise:Write -> Old Normalise:Write

Standard error:
MATLAB code threw an exception:
No executable modules, but still unresolved dependencies or incomplete module inputs.
File:/usr/local/MATLAB/R2016b/toolbox/spm12/spm_jobman.m
Name:/usr/local/MATLAB/R2016b/toolbox/spm12/spm_jobman.m
Line:47
File:home/ankita/preprocess/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/normalize_struc/pyscript_normalize.m
Name:fill_run_job
Line:115
File:pm_jobman
Name:pyscript_normalize
Line:461
File:\xc3\xb7
Name:�
Line:
Return code: 0
Interface MatlabCommand failed to run. 
Interface Normalize failed to run. 
@mgxd mgxd added the question label Mar 21, 2017
@mgxd
Copy link
Member

mgxd commented Mar 21, 2017

I believe the script you're using is only compatible with SPM versions < 12. The workflow you are using is wrapping the old normalize function, while SPM12 is using a newer version of the function. @satra wdyt?

@ankita940
Copy link
Author

ankita940 commented Mar 21, 2017

Hello,
yeah I think its compatible with spm8 can you suggest changes which needs to be done in normalization in following script I am attaching.

#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
==========================
fMRI: SPM Auditory dataset
==========================

Introduction
============

The fmri_spm_auditory.py recreates the classical workflow described in the
`SPM8 manual <http://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf>`_ using auditory
dataset that can be downloaded from http://www.fil.ion.ucl.ac.uk/spm/data/auditory/::

    python fmri_spm_auditory.py

Import necessary modules from nipype."""

from builtins import range
from nipype.utils import NUMPY_MMAP
import nipype.interfaces.io as nio           # Data i/o
import nipype.interfaces.spm as spm          # spm
import nipype.interfaces.fsl as fsl          # fsl
import nipype.interfaces.matlab as mlab      # how to run matlab
import nipype.interfaces.fsl as fsl          # fsl
import nipype.interfaces.utility as util     # utility
import nipype.pipeline.engine as pe          # pypeline engine
import nipype.algorithms.modelgen as model   # model specification
import os                                    # system functions


"""

Preliminaries
-------------

"""

# Set the way matlab should be called
mlab.MatlabCommand.set_default_matlab_cmd("matlab -nodesktop -nosplash")
#mlab.MatlabCommand.set_default_paths('/home/ankita/spmsoft/spm12/spm.m')

"""
Setting up workflows
--------------------

In this tutorial we will be setting up a hierarchical workflow for spm
analysis. This will demonstrate how pre-defined workflows can be setup
and shared across users, projects and labs.


Setup preprocessing workflow
----------------------------

This is a generic preprocessing workflow that can be used by different analyses

"""

preproc = pe.Workflow(name='preproc')

"""We strongly encourage to use 4D files insteead of series of 3D for fMRI analyses
for many reasons (cleanness and saving and filesystem inodes are among them). However,
the the workflow presented in the SPM8 manual which this tutorial is based on
uses 3D files. Therefore we leave converting to 4D as an option. We are using `merge_to_4d`
variable, because switching between 3d and 4d requires some additional steps (explauned later on).
Use :class:`nipype.interfaces.fsl.Merge` to merge a series of 3D files along the time
dimension creating a 4d file.
"""

merge_to_4d =False

if merge_to_4d:
    merge = pe.Node(interface=fsl.Merge(), name="merge")
    merge.inputs.dimension = "t"

"""Use :class:`nipype.interfaces.spm.Realign` for motion correction
and register all images to the mean image.
"""

realign = pe.Node(interface=spm.Realign(), name="realign")


"""Use :class:`nipype.interfaces.spm.Coregister` to perform a rigid
body registration of the functional data to the structural data.
"""

coregister = pe.Node(interface=spm.Coregister(), name="coregister")
coregister.inputs.jobtype = 'estimate'


segment = pe.Node(interface=spm.Segment(), name="segment")

"""Uncomment the following line for faster execution
"""

# segment.inputs.gaussians_per_class = [1, 1, 1, 4]

"""Warp functional and structural data to SPM's T1 template using
:class:`nipype.interfaces.spm.Normalize`.  The tutorial data set
includes the template image, T1.nii.
"""

normalize_func = pe.Node(interface=spm.Normalize(), name="normalize_func")
normalize_func.inputs.jobtype = "write"

normalize_struc = pe.Node(interface=spm.Normalize(), name="normalize_struc")
normalize_struc.inputs.jobtype = "write"


"""Smooth the functional data using
:class:`nipype.interfaces.spm.Smooth`.
"""

smooth = pe.Node(interface=spm.Smooth(), name="smooth")

"""`write_voxel_sizes` is the input of the normalize interface that is recommended to be set to
the voxel sizes of the target volume. There is no need to set it manually since we van infer it from data
using the following function:
"""


def get_vox_dims(volume):
    import nibabel as nb
    from nipype.utils import NUMPY_MMAP
    if isinstance(volume, list):
        volume = volume[0]
    nii = nb.load(volume, mmap=NUMPY_MMAP)
    hdr = nii.header
    voxdims = hdr.get_zooms()
    return [float(voxdims[0]), float(voxdims[1]), float(voxdims[2])]

"""Here we are connecting all the nodes together. Notice that we add the merge node only if you choose
to use 4D. Also `get_vox_dims` function is passed along the input volume of normalise to set the optimal
voxel sizes.
"""

if merge_to_4d:
    preproc.connect([(merge, realign, [('merged_file', 'in_files')])])

preproc.connect([(realign, coregister, [('mean_image', 'target')]),
                 (coregister, segment, [('coregistered_source', 'data')]),
                 (segment, normalize_func, [('transformation_mat', 'parameter_file')]),
                 (segment, normalize_struc, [('transformation_mat', 'parameter_file'),
                                             ('modulated_input_image', 'apply_to_files'),
                                             (('modulated_input_image', get_vox_dims), 'write_voxel_sizes')]),
                 (realign, normalize_func, [('realigned_files', 'apply_to_files'),
                                            (('realigned_files', get_vox_dims), 'write_voxel_sizes')]),
                 (normalize_func, smooth, [('normalized_files', 'in_files')]),
                 ])


"""
Set up analysis workflow
------------------------

"""

l1analysis = pe.Workflow(name='analysis')

"""Generate SPM-specific design information using
:class:`nipype.interfaces.spm.SpecifyModel`.
"""

modelspec = pe.Node(interface=model.SpecifySPMModel(), name="modelspec")

"""Generate a first level SPM.mat file for analysis
:class:`nipype.interfaces.spm.Level1Design`.
"""

level1design = pe.Node(interface=spm.Level1Design(), name="level1design")
level1design.inputs.bases = {'hrf': {'derivs': [0, 0]}}

"""Use :class:`nipype.interfaces.spm.EstimateModel` to determine the
parameters of the model.
"""

level1estimate = pe.Node(interface=spm.EstimateModel(), name="level1estimate")
level1estimate.inputs.estimation_method = {'Classical': 1}

threshold = pe.Node(interface=spm.Threshold(), name="threshold")


"""Use :class:`nipype.interfaces.spm.EstimateContrast` to estimate the
first level contrasts specified in a few steps above.
"""

contrastestimate = pe.Node(interface=spm.EstimateContrast(), name="contrastestimate")

l1analysis.connect([(modelspec, level1design, [('session_info', 'session_info')]),
                    (level1design, level1estimate, [('spm_mat_file', 'spm_mat_file')]),
                    (level1estimate, contrastestimate, [('spm_mat_file', 'spm_mat_file'),
                                                        ('beta_images', 'beta_images'),
                                                        ('residual_image', 'residual_image')]),
                    (contrastestimate, threshold, [('spm_mat_file', 'spm_mat_file'),
                                                   ('spmT_images', 'stat_image')]),
                    ])

"""
Preproc + Analysis pipeline
---------------------------

"""


l1pipeline = pe.Workflow(name='firstlevel')
l1pipeline.connect([(preproc, l1analysis, [('realign.realignment_parameters',
                                            'modelspec.realignment_parameters')])])

"""Pluging in `functional_runs` is a bit more complicated, because model spec expects a list of `runs`.
Every run can be a 4D file or a list of 3D files. Therefore for 3D analysis we need a list of lists and
to make one we need a helper function.
"""

if merge_to_4d:
    l1pipeline.connect([(preproc, l1analysis, [('smooth.smoothed_files',
                                                'modelspec.functional_runs')])])
else:
    def makelist(item):
        return [item]
    l1pipeline.connect([(preproc, l1analysis, [(('smooth.smoothed_files', makelist),
                                                'modelspec.functional_runs')])])


"""
Data specific components
------------------------

In this tutorial there is only one subject `M00223`.

Below we set some variables to inform the ``datasource`` about the
layout of our data.  We specify the location of the data, the subject
sub-directories and a dictionary that maps each run to a mnemonic (or
field) for the run type (``struct`` or ``func``).  These fields become
the output fields of the ``datasource`` node in the pipeline.
"""

# Specify the location of the data downloaded from http://www.fil.ion.ucl.ac.uk/spm/data/auditory/
data_dir = os.path.abspath('/home/ankita/preprocess/MoAEpilot')
# Specify the subject directories
subject_list = ['M00223']
# Map field names to individual subject runs.
info = dict(func=[['f', 'subject_id', 'f', 'subject_id', list(range(16, 100))]],
            struct=[['s', 'subject_id', 's', 'subject_id', 2]])

infosource = pe.Node(interface=util.IdentityInterface(fields=['subject_id']), name="infosource")

"""Here we set up iteration over all the subjects. The following line
is a particular example of the flexibility of the system.  The
``datasource`` attribute ``iterables`` tells the pipeline engine that
it should repeat the analysis on each of the items in the
``subject_list``. In the current example, the entire first level
preprocessing and estimation will be repeated for each subject
contained in subject_list.
"""

infosource.iterables = ('subject_id', subject_list)

"""
Now we create a :class:`nipype.interfaces.io.DataGrabber` object and
fill in the information from above about the layout of our data.  The
:class:`nipype.pipeline.NodeWrapper` module wraps the interface object
and provides additional housekeeping and pipeline specific
functionality.
"""

datasource = pe.Node(interface=nio.DataGrabber(infields=['subject_id'],
                                               outfields=['func', 'struct']),
                     name='datasource')
datasource.inputs.base_directory = data_dir
datasource.inputs.template = '%s%s/%s%s_%03d.img'
datasource.inputs.template_args = info
datasource.inputs.sort_filelist = True


"""
Experimental paradigm specific components
-----------------------------------------

Here we create a structure that provides information
about the experimental paradigm. This is used by the
:class:`nipype.interfaces.spm.SpecifyModel` to create the information
necessary to generate an SPM design matrix.
"""

from nipype.interfaces.base import Bunch
subjectinfo = [Bunch(conditions=['Task'],
                     onsets=[list(range(6, 84, 12))],
                     durations=[[6]])]

"""Setup the contrast structure that needs to be evaluated. This is a
list of lists. The inner list specifies the contrasts and has the
following format - [Name,Stat,[list of condition names],[weights on
those conditions]. The condition names must match the `names` listed
in the `subjectinfo` function described above.
"""

cont1 = ('active > rest', 'T', ['Task'], [1])
contrasts = [cont1]

# set up node specific inputs
modelspecref = l1pipeline.inputs.analysis.modelspec
modelspecref.input_units = 'scans'
modelspecref.output_units = 'scans'
modelspecref.time_repetition = 7
modelspecref.high_pass_filter_cutoff = 120

l1designref = l1pipeline.inputs.analysis.level1design
l1designref.timing_units = modelspecref.output_units
l1designref.interscan_interval = modelspecref.time_repetition

l1pipeline.inputs.preproc.smooth.fwhm = [6, 6, 6]
l1pipeline.inputs.analysis.modelspec.subject_info = subjectinfo
l1pipeline.inputs.analysis.contrastestimate.contrasts = contrasts
l1pipeline.inputs.analysis.threshold.contrast_index = 1

"""
Setup the pipeline
------------------

The nodes created above do not describe the flow of data. They merely
describe the parameters used for each function. In this section we
setup the connections between the nodes such that appropriate outputs
from nodes are piped into appropriate inputs of other nodes.

Use the :class:`nipype.pipeline.engine.Pipeline` to create a
graph-based execution pipeline for first level analysis. The config
options tells the pipeline engine to use `workdir` as the disk
location to use when running the processes and keeping their
outputs. The `use_parameterized_dirs` tells the engine to create
sub-directories under `workdir` corresponding to the iterables in the
pipeline. Thus for this pipeline there will be subject specific
sub-directories.

The ``nipype.pipeline.engine.Pipeline.connect`` function creates the
links between the processes, i.e., how data should flow in and out of
the processing nodes.
"""

level1 = pe.Workflow(name="level1")
level1.base_dir = os.path.abspath('spm_auditory_tutorial/workingdir')

level1.connect([(infosource, datasource, [('subject_id', 'subject_id')]),
                (datasource, l1pipeline, [('struct', 'preproc.coregister.source')])
                ])
if merge_to_4d:
    level1.connect([(datasource, l1pipeline, [('func', 'preproc.merge.in_files')])])
else:
    level1.connect([(datasource, l1pipeline, [('func', 'preproc.realign.in_files')])])


"""

Setup storage results
---------------------

Use :class:`nipype.interfaces.io.DataSink` to store selected outputs
from the pipeline in a specific location. This allows the user to
selectively choose important output bits from the analysis and keep
them.

The first step is to create a datasink node and then to connect
outputs from the modules above to storage locations. These take the
following form directory_name[.[@]subdir] where parts between [] are
optional. For example 'realign.@mean' below creates a directory called
realign in 'l1output/subject_id/' and stores the mean image output
from the Realign process in the realign directory. If the @ is left
out, then a sub-directory with the name 'mean' would be created and
the mean image would be copied to that directory.
"""

datasink = pe.Node(interface=nio.DataSink(), name="datasink")
datasink.inputs.base_directory = os.path.abspath('spm_auditory_tutorial/l1output')


def getstripdir(subject_id):
    import os
    return os.path.join(os.path.abspath('spm_auditory_tutorial/workingdir'), '_subject_id_%s' % subject_id)

# store relevant outputs from various stages of the 1st level analysis
level1.connect([(infosource, datasink, [('subject_id', 'container'),
                                        (('subject_id', getstripdir), 'strip_dir')]),
                (l1pipeline, datasink, [('analysis.contrastestimate.con_images', 'contrasts.@con'),
                                        ('analysis.contrastestimate.spmT_images', 'contrasts.@T')]),
                ])


"""
Execute the pipeline
--------------------

The code discussed above sets up all the necessary data structures
with appropriate parameters and the connectivity between the
processes, but does not generate any output. To actually run the
analysis on the data the ``nipype.pipeline.engine.Pipeline.Run``
function needs to be called.
"""

if __name__ == '__main__':
    level1.run()
    level1.write_graph()

@satra
Copy link
Member

satra commented Mar 22, 2017

@mgxd - can you check out the workflow on the tutorial dataset. in theory it should work, but the crashfile suggests that the interface is not getting any inputs, and therefore the output of segment is not working:

                 (segment, normalize_struc, [('transformation_mat', 'parameter_file'),
                                             ('modulated_input_image', 'apply_to_files'),
                                             (('modulated_input_image', get_vox_dims), 'write_voxel_sizes')]),

@ankita940 - could you please report the contents of the _report.rst inside the segment working directory?

@ankita940
Copy link
Author

ankita940 commented Mar 22, 2017

Hello @satra ,

Below attached the content of _report.rst file:
P.S. The preprocessing is making normalize, smoothing output folder too but crash file is there for normalization_structural then how is it working.

Node: firstlevel (preproc (segment (spm)

Hierarchy : level1.firstlevel.preproc.segment
Exec ID : segment.a0

Original Inputs

  • affine_regularization :
  • bias_fwhm :
  • bias_regularization :
  • clean_masks :
  • csf_output_type :
  • data : [u'/home/ankita/preprocess/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/coregister/sM00223_002.img']
  • gaussians_per_class :
  • gm_output_type :
  • ignore_exception : False
  • mask_image :
  • matlab_cmd :
  • mfile : True
  • paths :
  • sampling_distance :
  • save_bias_corrected :
  • tissue_prob_maps :
  • use_mcr :
  • use_v8struct : True
  • warp_frequency_cutoff :
  • warping_regularization :
  • wm_output_type :

Execution Inputs

  • affine_regularization :
  • bias_fwhm :
  • bias_regularization :
  • clean_masks :
  • csf_output_type :
  • data : [u'/home/ankita/preprocess/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/segment/sM00223_002.img']
  • gaussians_per_class :
  • gm_output_type :
  • ignore_exception : False
  • mask_image :
  • matlab_cmd :
  • mfile : True
  • paths :
  • sampling_distance :
  • save_bias_corrected :
  • tissue_prob_maps :
  • use_mcr :
  • use_v8struct : True
  • warp_frequency_cutoff :
  • warping_regularization :
  • wm_output_type :

Execution Outputs

  • bias_corrected_image :
  • inverse_transformation_mat :
  • modulated_csf_image :
  • modulated_gm_image :
  • modulated_input_image :
  • modulated_wm_image :
  • native_csf_image :
  • native_gm_image :
  • native_wm_image :
  • normalized_csf_image :
  • normalized_gm_image :
  • normalized_wm_image :
  • transformation_mat : /home/ankita/preprocess/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/segment/sM00223_002_seg_sn.mat

Runtime info

  • duration : 155.0654
  • hostname : ankita-PC

Terminal output




Environment
~~~~~~~~~~~

* ANTSPATH : /opt/ants/bin/
* CLUTTER_IM_MODULE : xim
* COLORTERM : gnome-terminal
* COMPIZ_BIN_PATH : /usr/bin/
* COMPIZ_CONFIG_PROFILE : ubuntu
* DBUS_SESSION_BUS_ADDRESS : unix:abstract=/tmp/dbus-nojydSCeD5
* DEFAULTS_PATH : /usr/share/gconf/ubuntu.default.path
* DERBY_HOME : /usr/lib/jvm/jdk1.7.0_121/db
* DESKTOP_SESSION : ubuntu
* DISPLAY : :0
* DYLD_FALLBACK_LIBRARY_PATH : /opt/afni
* FSLBROWSER : /etc/alternatives/x-www-browser
* FSLDIR : /usr/share/fsl/4.1
* FSLLOCKDIR : 
* FSLMACHINELIST : 
* FSLMULTIFILEQUIT : TRUE
* FSLOUTPUTTYPE : NIFTI_GZ
* FSLREMOTECALL : 
* FSLTCLSH : /usr/bin/tclsh
* FSLWISH : /usr/bin/wish
* GDMSESSION : ubuntu
* GDM_LANG : en_US
* GNOME_DESKTOP_SESSION_ID : this-is-deprecated
* GNOME_KEYRING_CONTROL : /run/user/1000/keyring-t88buF
* GNOME_KEYRING_PID : 31286
* GPG_AGENT_INFO : /run/user/1000/keyring-t88buF/gpg:0:1
* GTK_IM_MODULE : ibus
* GTK_MODULES : overlay-scrollbar:unity-gtk-module
* HOME : /home/ankita
* IM_CONFIG_PHASE : 1
* INSTANCE : 
* J2REDIR : /usr/lib/jvm/jdk1.7.0_121/jre
* J2SDKDIR : /usr/lib/jvm/jdk1.7.0_121
* JAVA_HOME : /usr/local/java/jdk1.8.0_51
* JOB : dbus
* LANG : en_IN
* LANGUAGE : en_IN:en
* LD_LIBRARY_PATH : /usr/lib/fsl/4.1:/usr/lib/fsl/5.0
* LESSCLOSE : /usr/bin/lesspipe %s %s
* LESSOPEN : | /usr/bin/lesspipe %s
* LOGNAME : ankita
* LS_COLORS : rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
* MANDATORY_PATH : /usr/share/gconf/ubuntu.mandatory.path
* MATLABCMD : /usr/local/MATLAB/R2016b/bin/glnxa64/MATLAB
* NO_PROXY : localhost,127.0.0.0/8,::1
* OLDPWD : /home/ankita
* PATH : /usr/local/MATLAB/R2016b/bin:/usr/share/fsl/4.1/4.1/bin:/home/ankita/anaconda2/bin:/home/ankita/miniconda2/bin:/opt/c3d/bin:/opt/afni:/usr/share/fsl/5.0/bin:/usr/lib/fsl/5.0:/opt/c3d/bin:/opt/afni:/usr/share/fsl/5.0/bin:/opt/c3d/bin:/opt/afni:/usr/share/fsl/5.0/bin:/opt/c3d/bin:/opt/ants/bin:/opt/afni:/usr/share/fsl/5.0/bin:/opt/afni:/usr/share/fsl/5.0/bin:/opt/c3d/bin:/opt/ants/bin:/opt/afni:/usr/share/fsl/5.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/jdk1.7.0_121/bin:/usr/lib/jvm/jdk1.7.0_121/db/bin:/usr/lib/jvm/jdk1.7.0_121/jre/bin:/home/ankita/bin:/usr/local/java/jdk1.8.0_51/bin:/usr/lib/fsl/4.1
* POSSUMDIR : /usr/share/fsl/4.1
* PT7HOME : /opt/pt
* PWD : /home/ankita/preprocess
* QT4_IM_MODULE : xim
* QT_IM_MODULE : ibus
* QT_QPA_PLATFORMTHEME : appmenu-qt5
* SELINUX_INIT : YES
* SESSION : ubuntu
* SESSIONTYPE : gnome-session
* SESSION_MANAGER : local/ankita-PC:@/tmp/.ICE-unix/31553,unix/ankita-PC:/tmp/.ICE-unix/31553
* SHELL : /bin/bash
* SHLVL : 1
* SPM_PATH : /usr/local/MATLAB/R2016b/toolbox/spm12/
* SSH_AUTH_SOCK : /run/user/1000/keyring-t88buF/ssh
* TERM : xterm
* TEXTDOMAIN : im-config
* TEXTDOMAINDIR : /usr/share/locale/
* UPSTART_SESSION : unix:abstract=/com/ubuntu/upstart-session/1000/31288
* USER : ankita
* VTE_VERSION : 3409
* WINDOWID : 73400331
* XAUTHORITY : /home/ankita/.Xauthority
* XDG_CONFIG_DIRS : /etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
* XDG_CURRENT_DESKTOP : Unity
* XDG_DATA_DIRS : /usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/
* XDG_GREETER_DATA_DIR : /var/lib/lightdm-data/ankita
* XDG_MENU_PREFIX : gnome-
* XDG_RUNTIME_DIR : /run/user/1000
* XDG_SEAT : seat0
* XDG_SEAT_PATH : /org/freedesktop/DisplayManager/Seat0
* XDG_SESSION_ID : c4
* XDG_SESSION_PATH : /org/freedesktop/DisplayManager/Session1
* XDG_VTNR : 7
* XMODIFIERS : @im=ibus
* _ : /home/ankita/anaconda2/bin/python
* ftp_proxy : ftp://proxy.iiit.ac.in:8080/
* http_proxy : http://proxy.iiit.ac.in:8080/
* https_proxy : https://proxy.iiit.ac.in:8080/
* no_proxy : localhost,127.0.0.0/8,::1

@satra
Copy link
Member

satra commented Mar 22, 2017

@ankita940 - could you try adding this line after the segment node is defined:

segment.inputs.save_bias_corrected = True

and then run it again?

@ankita940
Copy link
Author

ankita940 commented Mar 22, 2017

Hello @satra

Its again giving an error regarding normalize but now i guess its because of may be version

Here is the crash file generated-

File: crash-20170322-203217-ankita-normalize_struc.a0-c2864d14-984d-43eb-851d-b0ac8b1c48f6.pklz
Node: level1.firstlevel.preproc.normalize_struc.a0
Working directory: /home/ankita/preprocess/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/normalize_struc


Node inputs:

DCT_period_cutoff = <undefined>
affine_regularization_type = <undefined>
apply_to_files = <undefined>
ignore_exception = False
jobtype = write
matlab_cmd = <undefined>
mfile = True
nonlinear_iterations = <undefined>
nonlinear_regularization = <undefined>
out_prefix = w
parameter_file = /home/ankita/preprocess/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/normalize_struc/sM00223_002_seg_sn.mat
paths = <undefined>
source = <undefined>
source_image_smoothing = <undefined>
source_weight = <undefined>
template = <undefined>
template_image_smoothing = <undefined>
template_weight = <undefined>
use_mcr = <undefined>
use_v8struct = True
write_bounding_box = <undefined>
write_interp = <undefined>
write_preserve = <undefined>
write_voxel_sizes = <undefined>
write_wrap = <undefined>



Traceback: 
Traceback (most recent call last):
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/pipeline/plugins/linear.py", line 43, in run
    node.run(updatehash=updatehash)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 366, in run
    self._run_interface()
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 476, in _run_interface
    self._result = self._run_command(execute)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 607, in _run_command
    result = self._interface.run()
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1085, in run
    runtime = self._run_wrapper(runtime)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1033, in _run_wrapper
    runtime = self._run_interface(runtime)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/spm/base.py", line 323, in _run_interface
    results = self.mlab.run()
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1085, in run
    runtime = self._run_wrapper(runtime)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1728, in _run_wrapper
    runtime = self._run_interface(runtime)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/matlab.py", line 152, in _run_interface
    self.raise_exception(runtime)
  File "/home/ankita/anaconda2/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1686, in raise_exception
    **runtime.dictcopy()))
RuntimeError: Command:
matlab -nodesktop -nosplash -nodesktop -nosplash -singleCompThread -r "addpath('/home/ankita/preprocess/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/normalize_struc');pyscript_normalize;exit"
Standard output:
MATLAB is selecting SOFTWARE OPENGL rendering.

                            < M A T L A B (R) >
                  Copyright 1984-2016 The MathWorks, Inc.
                   R2016b (9.1.0.441655) 64-bit (glnxa64)
                             September 7, 2016

 
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
 
Executing pyscript_normalize at 22-Mar-2017 20:32:01:
----------------------------------------------------------------------------------------------------
MATLAB Version: 9.1.0.441655 (R2016b)
MATLAB License Number: 40480989
Operating System: Linux 3.16.0-60-generic #80~14.04.1-Ubuntu SMP Wed Jan 20 13:37:48 UTC 2016 x86_64
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB                                                Version 9.1         (R2016b)
Simulink                                              Version 8.8         (R2016b)
Antenna Toolbox                                       Version 2.1         (R2016b)
Audio System Toolbox                                  Version 1.1         (R2016b)
Bioinformatics Toolbox                                Version 4.7         (R2016b)
Communications System Toolbox                         Version 6.3         (R2016b)
Computer Vision System Toolbox                        Version 7.2         (R2016b)
Control System Toolbox                                Version 10.1        (R2016b)
Curve Fitting Toolbox                                 Version 3.5.4       (R2016b)
DSP System Toolbox                                    Version 9.3         (R2016b)
Database Toolbox                                      Version 7.0         (R2016b)
Embedded Coder                                        Version 6.11        (R2016b)
Filter Design HDL Coder                               Version 3.1         (R2016b)
Fixed-Point Designer                                  Version 5.3         (R2016b)
Fuzzy Logic Toolbox                                   Version 2.2.24      (R2016b)
Global Optimization Toolbox                           Version 3.4.1       (R2016b)
HDL Coder                                             Version 3.9         (R2016b)
HDL Verifier                                          Version 5.1         (R2016b)
Image Acquisition Toolbox                             Version 5.1         (R2016b)
Image Processing Toolbox                              Version 9.5         (R2016b)
Instrument Control Toolbox                            Version 3.10        (R2016b)
LTE System Toolbox                                    Version 2.3         (R2016b)
MATLAB Coder                                          Version 3.2         (R2016b)
MATLAB Report Generator                               Version 5.1         (R2016b)
Mapping Toolbox                                       Version 4.4         (R2016b)
Model Predictive Control Toolbox                      Version 5.2.1       (R2016b)
Neural Network Toolbox                                Version 9.1         (R2016b)
Optimization Toolbox                                  Version 7.5         (R2016b)
Parallel Computing Toolbox                            Version 6.9         (R2016b)
Partial Differential Equation Toolbox                 Version 2.3         (R2016b)
Phased Array System Toolbox                           Version 3.3         (R2016b)
RF Toolbox                                            Version 3.1         (R2016b)
Robotics System Toolbox                               Version 1.3         (R2016b)
Robust Control Toolbox                                Version 6.2         (R2016b)
Signal Processing Toolbox                             Version 7.3         (R2016b)
SimRF                                                 Version 5.1         (R2016b)
Simscape                                              Version 4.1         (R2016b)
Simscape Driveline                                    Version 2.11        (R2016b)
Simscape Electronics                                  Version 2.10        (R2016b)
Simscape Multibody                                    Version 4.9         (R2016b)
Simulink 3D Animation                                 Version 7.6         (R2016b)
Simulink Control Design                               Version 4.4         (R2016b)
Stateflow                                             Version 8.8         (R2016b)
Statistical Parametric Mapping                        Version 6906        (SPM12) 
Statistics and Machine Learning Toolbox               Version 11.0        (R2016b)
Symbolic Math Toolbox                                 Version 7.1         (R2016b)
System Identification Toolbox                         Version 9.5         (R2016b)
WLAN System Toolbox                                   Version 1.2         (R2016b)
Wavelet Toolbox                                       Version 4.17        (R2016b)
SPM version: SPM12 Release: 6906
SPM path: /usr/local/MATLAB/R2016b/toolbox/spm12/spm.m
Conversion Normalise:Write -> Old Normalise:Write

Standard error:
MATLAB code threw an exception:
No executable modules, but still unresolved dependencies or incomplete module inputs.
File:/usr/local/MATLAB/R2016b/toolbox/spm12/spm_jobman.m
Name:/usr/local/MATLAB/R2016b/toolbox/spm12/spm_jobman.m
Line:47
File:home/ankita/preprocess/spm_auditory_tutorial/workingdir/level1/firstlevel/preproc/_subject_id_M00223/normalize_struc/pyscript_normalize.m
Name:fill_run_job
Line:115
File:pm_jobman
Name:pyscript_normalize
Line:461
File:\xc3\xb7
Name:�
Line:
Return code: 0
Interface MatlabCommand failed to run. 
Interface Normalize failed to run. 

@ankita940
Copy link
Author

ankita940 commented Mar 28, 2017

Hello @satra @mgxd ,
What should I do to make normalization work and can you let me know is this compatability issue or something else since I am working on spm12 and the script is for spm8. If so can I change the script to make it work or I have to find script compatible with spm12.

Is there is some dependency that is missing from system.Please can anyone help me to solve the problem

Any help will be appreciated.

@mgxd
Copy link
Member

mgxd commented Mar 31, 2017

@ankita940 AFAIK, this is a compatibility issue with SPM12. We'll have to revisit this workflow and update it for both versions of SPM

@ankita940
Copy link
Author

@mgxd
I am using matlab version R2016b and now if i will use spm8 with it will this script written for spm8 will work in this environment

@mgxd
Copy link
Member

mgxd commented Apr 10, 2017

@ankita940 have you tried with spm8? if so, can you verify that was the problem?

@hurtb
Copy link

hurtb commented Apr 25, 2017

@ankita940 had a similar error trying to run Normalize12 with Matlab2017A. It executed successfully by specifying the tpm kwarg to spm's MNI file.

# Normalize to apply the transformations - spm.Normalize12
normalize = pe.Node(spm.Normalize12(), name='normalize')
normalize.inputs.jobtype = 'estwrite'
normalize.inputs.tpm = '/usr/local/MATLAB/R2017a/toolbox/spm12/tpm/TPM.nii'
normalize.inputs.image_to_align = 'structural.nii'
normalize.inputs.apply_to_files = 'functional.nii'

Unfortunately I do not know why this is the case, but it seems like the template file is not being set correctly in the cmd-line call to matlab. You all are the experts, though.

@mgxd
Copy link
Member

mgxd commented Apr 26, 2017

@hurtb are you including the property inputs to your declarations? aka

normalize.inputs.image_to_align = 'structural.nii'

@hurtb
Copy link

hurtb commented Jun 3, 2017

@mgxd - yes. All of the Node inputs are in the form you describe.

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

No branches or pull requests

4 participants