Error: fMRI preprocessing run Dartel (existing templates) in Nipype

Dear all,
I am currently running preprocessing with a pipeline new segment +DARTEL (existing templates) with code:
from nipype.interfaces.spm import DARTEL
dartel=Node(DARTEL(),name=‘dartel’)
preproc.connect(newsegment,dartel,[(‘dartel_input_images’, ‘apply_to_files’)]).

The idea behind is that I want to connect rc1.nii and rc2.nii files generated in newsegement and apply them into the dartel template, but there was always a long error message. On the bottom is the main part of the error message:**

Besides, I also checked the reported output file of newsegment and found that the dartel_input_images in a way with four blank brackets, for example:
Execution Outputs

dartel_input_images :

[[’/home/zhaoy90/mnt/p/userdata/zhaoy90/test/output/work_preproc/_run_id_1_subject_id_01/newsegment/rc1rsub-01_T1w.nii’], [’/home/zhaoy90/mnt/p/userdata/zhaoy90/test/output/work_preproc/_run_id_1_subject_id_01/newsegment/rc2rsub-01_T1w.nii’], [], [], [], []]**

I think it was because I only chose to segment native +Dartel imported tissue for grey matter and white matter but did chose Dartel imported for there other 4 tissues, but I still have no idea how to get rid of the blank brackets if that’s the point.

Could someone of you give me some suggestions on whether my understanding is correct and how to solve the problem?

Thanks for your help in advance!

200110-16:02:23,940 nipype.workflow INFO:
[Node] Setting-up “work_preproc.dartel” in “/home/zhaoy90/mnt/p/userdata/zhaoy90/test/output/work_preproc/_run_id_1_subject_id_01/dartel”.
200110-16:02:24,562 nipype.workflow INFO:
[Node] Running “dartel” (“nipype.interfaces.spm.preprocess.DARTEL”)
200110-16:02:25,872 nipype.workflow INFO:
[MultiProc] Running 4 tasks, and 0 jobs ready. Free memory (GB): 225.82/226.62, Free processors: 0/4.
Currently running:

  • work_preproc.dartel
  • work_preproc.dartel
  • work_preproc.dartel
  • work_preproc.dartel
    200110-16:02:27,357 nipype.workflow WARNING:
    Storing result file without outputs
    200110-16:02:27,369 nipype.workflow WARNING:
    [Node] Error on “work_preproc.dartel” (/home/zhaoy90/mnt/p/userdata/zhaoy90/test/output/work_preproc/_run_id_4_subject_id_01/dartel)
    200110-16:02:27,879 nipype.workflow ERROR:
    Node dartel.a3 failed to run on host neuronix.
    200110-16:02:27,881 nipype.workflow ERROR:
    Saving crash info to /home/zhaoy90/mnt/p/userdata/zhaoy90/ZHAO_Yili/scripts/crash-20200110-160227-zhaoy90-dartel.a3-7106495a-d80f-437e-a73b-8849bbea85cf.pklz
    Traceback (most recent call last):
    File “/usr/local/lib/python3.6/dist-packages/nipype/pipeline/plugins/multiproc.py”, line 69, in run_node
    result[‘result’] = node.run(updatehash=updatehash)
    File “/usr/local/lib/python3.6/dist-packages/nipype/pipeline/engine/nodes.py”, line 473, in run
    result = self._run_interface(execute=True)
    File “/usr/local/lib/python3.6/dist-packages/nipype/pipeline/engine/nodes.py”, line 564, in _run_interface
    return self._run_command(execute)
    File “/usr/local/lib/python3.6/dist-packages/nipype/pipeline/engine/nodes.py”, line 649, in _run_command
    result = self._interface.run(cwd=outdir)
    File “/usr/local/lib/python3.6/dist-packages/nipype/interfaces/base/core.py”, line 376, in run
    runtime = self._run_interface(runtime)
    File “/usr/local/lib/python3.6/dist-packages/nipype/interfaces/spm/base.py”, line 377, in _run_interface
    results = self.mlab.run()
    File “/usr/local/lib/python3.6/dist-packages/nipype/interfaces/base/core.py”, line 376, in run
    runtime = self._run_interface(runtime)
    File “/usr/local/lib/python3.6/dist-packages/nipype/interfaces/matlab.py”, line 170, in _run_interface
    self.raise_exception(runtime)
    File “/usr/local/lib/python3.6/dist-packages/nipype/interfaces/base/core.py”, line 698, in raise_exception
    ).format(**runtime.dictcopy()))
    RuntimeError: Command:
    matlab -nodesktop -nosplash -singleCompThread -r “addpath(’/home/zhaoy90/mnt/p/userdata/zhaoy90/test/output/work_preproc/_run_id_4_subject_id_01/dartel’);pyscript_dartel;exit”
    Standard output:
    MATLAB is selecting SOFTWARE OPENGL rendering.
                        < M A T L A B (R) >
              Copyright 1984-2018 The MathWorks, Inc.
          R2018b Update 4 (9.5.0.1067069) 64-bit (glnxa64)
                         February 28, 2019

To get started, type doc.
For product information, visit www.mathworks.com.

Running SCAN-Unit initialization script…
Initializing SPM for you. If you do not need SPM you can deactivate this in your startup.m file.

ans =

true

You are running Matlab in display mode. Figure and SPM windows will open normally.
Executing pyscript_dartel at 10-Jan-2020 16:02:15:

MATLAB Version: 9.5.0.1067069 (R2018b) Update 4
MATLAB License Number: 165049
Operating System: Linux 5.0.0-36-generic #39~18.04.1-Ubuntu SMP Tue Nov 12 11:09:50 UTC 2019 x86_64
Java Version: Java 1.8.0_152-b16 with Oracle Corporation Java HotSpot™ 64-Bit Server VM mixed mode

MATLAB Version 9.5 (R2018b)
Simulink Version 9.2 (R2018b)
Bioinformatics Toolbox Version 4.11 (R2018b)
Communications Toolbox Version 7.0 (R2018b)
Control System Toolbox Version 10.5 (R2018b)
Curve Fitting Toolbox Version 3.5.8 (R2018b)
DSP System Toolbox Version 9.7 (R2018b)
Deep Learning Toolbox Version 12.0 (R2018b)
Fuzzy Logic Toolbox Version 2.4 (R2018b)
Image Acquisition Toolbox Version 5.5 (R2018b)
Image Processing Toolbox Version 10.3 (R2018b)
Instrument Control Toolbox Version 3.14 (R2018b)
MATLAB Compiler Version 7.0 (R2018b)
MATLAB Compiler SDK Version 6.6 (R2018b)
Mapping Toolbox Version 4.7 (R2018b)
Optimization Toolbox Version 8.2 (R2018b)
Parallel Computing Toolbox Version 6.13 (R2018b)
Signal Processing Toolbox Version 8.1 (R2018b)
Statistical Parametric Mapping Version 7487 (SPM12)
Statistics and Machine Learning Toolbox Version 11.4 (R2018b)
Symbolic Math Toolbox Version 8.2 (R2018b)
System Identification Toolbox Version 9.9 (R2018b)
Wavelet Toolbox Version 5.1 (R2018b)
SPM version: SPM12 Release: 7487
SPM path: /opt/spm/spm12_7487/spm.m
Item ‘Images’, field ‘val’: Number of matching files (0) less than required (1).
Item ‘Images’, field ‘val’: Number of matching files (0) less than required (1).
Item ‘Images’, field ‘val’: Number of matching files (0) less than required (1).
Item ‘Images’, field ‘val’: Number of matching files (0) less than required (1).
Standard error:
MATLAB code threw an exception:
No executable modules, but still unresolved dependencies or incomplete module inputs.
File:/opt/spm/spm12_7487/spm_jobman.m
Name:/opt/spm/spm12_7487/spm_jobman.m
Line:47
File:home/zhaoy90/mnt/p/userdata/zhaoy90/test/output/work_preproc/_run_id_4_subject_id_01/dartel/pyscript_dartel.m
Name:fill_run_job
Line:115
File:pm_jobman
Name:pyscript_dartel
Line:472
File:÷
Name:$
Line:
Return code: 0