nipype icon indicating copy to clipboard operation
nipype copied to clipboard

spm.Normalize12() issue. Mutually exclusive fields, aren't ?

Open Brainarea opened this issue 3 years ago • 1 comments
trafficstars

When I'm trying to normalize some data using spm.Normalize12() with the following code, everything goes fine

norm = spm.Normalize12()
norm.inputs.image_to_align = os.path.join(T1_output_folder,'T1.nii')
norm.inputs.apply_to_files = [os.path.join(Recon_output_folder,'rrrRecon_full_run1.nii'),os.path.join(Recon_output_folder,'rrrRecon_full_run2.nii')]
norm.run()

But when I'm trying to use a deformation field instead like this:

norm = spm.Normalize12()
norm.inputs.deformation_file = os.path.join(T1_output_folder,'y_T1.nii')
norm.inputs.apply_to_files = [os.path.join(Recon_output_folder,'rrrRecon_full_run1.nii'),os.path.join(Recon_output_folder,'rrrRecon_full_run2.nii')]
norm.run()

Then Matlab is giving me this error:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In [41], line 6
      4 norm.inputs.apply_to_files = [os.path.join(Recon_output_folder,'rrrRecon_full_run1.nii'),os.path.join(Recon_output_folder,'rrrRecon_full_run2.nii')]
      5 #norm.inputs.write_voxel_sizes = [3,3,3]
----> 6 norm.run()

File /opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/nipype/interfaces/base/core.py:398, in BaseInterface.run(self, cwd, ignore_exception, **inputs)
    396 # Run interface
    397 runtime = self._pre_run_hook(runtime)
--> 398 runtime = self._run_interface(runtime)
    399 runtime = self._post_run_hook(runtime)
    400 # Collect outputs

File /opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/nipype/interfaces/spm/base.py:387, in SPMCommand._run_interface(self, runtime)
    383 """Executes the SPM function using MATLAB."""
    384 self.mlab.inputs.script = self._make_matlab_command(
    385     deepcopy(self._parse_inputs())
    386 )
--> 387 results = self.mlab.run()
    388 runtime.returncode = results.runtime.returncode
    389 if self.mlab.inputs.uses_mcr:

File /opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/nipype/interfaces/base/core.py:398, in BaseInterface.run(self, cwd, ignore_exception, **inputs)
    396 # Run interface
    397 runtime = self._pre_run_hook(runtime)
--> 398 runtime = self._run_interface(runtime)
    399 runtime = self._post_run_hook(runtime)
    400 # Collect outputs

File /opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/nipype/interfaces/matlab.py:164, in MatlabCommand._run_interface(self, runtime)
    162     pass
    163 if "MATLAB code threw an exception" in runtime.stderr:
--> 164     self.raise_exception(runtime)
    165 return runtime

File /opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/nipype/interfaces/base/core.py:686, in CommandLine.raise_exception(self, runtime)
    685 def raise_exception(self, runtime):
--> 686     raise RuntimeError(
    687         (
    688             "Command:\n{cmdline}\nStandard output:\n{stdout}\n"
    689             "Standard error:\n{stderr}\nReturn code: {returncode}"
    690         ).format(**runtime.dictcopy())
    691     )

RuntimeError: Command:
/opt/spm12-r7771/run_spm12.sh /ot/matlabmcr-2010a/v713 script /mymregdata/EXC24/MREG_recon_GRE/T1/pyscript_normalize12.m
Standard output:
SPM12, version 7771 (standalone)
MATLAB, version 7.10.0.499 (R2010a)
 ___  ____  __  __                                            
/ __)(  _ \(  \/  )                                           
\__ \ )___/ )    (   Statistical Parametric Mapping           
(___/(__)  (_/\/\_)  SPM12 - https://www.fil.ion.ucl.ac.uk/spm/

Executing /mymregdata/EXC24/MREG_recon_GRE/T1/pyscript_normalize12.m at 22-Sep-2022 13:35:26:
Executing /mymregdata/EXC24/MREG_recon_GRE/T1/pyscript_normalize12.m at 22-Sep-2022 13:35:26:
-------------------------------------------------------------------------------------
MATLAB Version 7.10.0.499 (R2010a)
MATLAB License Number: unknown
Operating System: Linux 3.10.0-1160.24.1.el7.x86_64 #1 SMP Thu Mar 25 21:21:56 UTC 2021 x86_64
Java VM Version: Java is not enabled
-------------------------------------------------------------------------------------
MATLAB                                                Version 7.10       (R2010a)
MATLAB Compiler                                       Version 4.13       (R2010a)
Signal Processing Toolbox                             Version 6.13       (R2010a)
SPM version: SPM12 Release: 7771
SPM path: /opt/spm12-r7771/spm12_mcr/spm12/spm.m
Item subj: No field(s) named
def
{Warning: The argument for the %s format specifier must be of type char (a
string).} 
  In spm at 1147
  In spm_standalone at 115
{Warning: The argument for the %s format specifier must be of type char (a
string).} 
  In spm at 1147
  In spm_standalone at 115
Standard error:
MATLAB code threw an exception:
No executable modules, but still unresolved dependencies or incomplete module inputs.

File:
/opt/spm12-r7771/spm12_mcr/spm12/spm_jobman.m

Name:
/opt/spm12-r7771/spm12_mcr/spm12/spm_jobman.m

Line:
47

File:
opt/spm12-r7771/spm12_mcr/spm12/spm.m

Name:
/opt/spm12-r7771/spm12_mcr/spm12/spm_standalone.m

Line:
102

File:
ill_run_job

Name:
spm_jobman

Line:
115

File:
pm

Name:
spm_standalone

Line:
472

File:
÷

Name:
\u047b

Line:
115

Return code: 0

Am I missing something? THanks!

Brainarea avatar Sep 22 '22 18:09 Brainarea

Hi,

expierencing the same issue! Did you find a solution?

Adorax2 avatar Jun 20 '23 22:06 Adorax2