Error using DPARSFA_run (line 819) Index exceeds the number of array elements (0).

Submitted by gerardyu on

Hi there, 

Thie above error seems to appear after the slice timing was completed successfully. I've checked that

1. all the subject folders have .nii file in the FunImgA directory

2. all of these .nii files have the same time point

3. all the subject folders have a .nii file in the T1Img directory

it would seem that the next step is the field map correction

i have the following field map files within the FieldMap directory for all subjects:

FieldMap/Magnitude1Raw/002/Mag1.nii

FieldMap/Magnitude2Raw/002/Mag2.nii

FieldMap/PhaseDiffRaw/002/PhaseDiff.nii

do see the attached image for the filed map correction settings

thanks in advance

YAN Chao-Gan

Fri, 02/19/2021 - 08:01

If you already converted from DICOM to NIfTI, then name as:

FieldMap/Magnitude1Img/002/Mag1.nii

FieldMap/Magnitude2Img/002/Mag2.nii

FieldMap/PhaseDiffImg/002/PhaseDiff.nii

Juergen Haenggi

Wed, 07/14/2021 - 15:11

Dear DPARSFA experts

I am trying to run DPARSFA (version 5.2) using field map correction, but get the following error as reported here by another user:

Error using DPARSFA_run (line 823)
Index exceeds the number of array elements (0).

I am working with NIFTI data and therefore my directory tree is as follow:
FunRaw --> Subject_01 --> *.nii  / *.json
T1Img --> Subject_01 --> *.nii / *.json
FieldMap --> Magnitude1Img --> Subject_01 --> *.nii / *.json
FieldMap --> Magnitude2Img --> Subject_01 --> *.nii / *.json
FieldMap --> PhaseDiffImg --> Subject_01 --> *.nii / *.json

Any idea what might cause this error?
Thanks in advance
Regards
Jürgen

Dear Prof. Yan

as suggested, I changed parfor in line 823 to for and get the following error:
------------------------------------------------------------
Reference to non-existent field 'ReconMatrixPE'.

Error in DPARSFA_run (line 871)
SPMJOB.matlabbatch{1,1}.spm.tools.fieldmap.calculatevdm.subj.defaults.defaultsval.tert=JSON.EffectiveEchoSpacing*JSON.ReconMatrixPE*1000;

Error in DPARSFA>pushbuttonRun_Callback (line 1847)
[Error, Cfg]=DPARSFA_run(handles.Cfg);

Error in gui_mainfcn (line 95)
feval(varargin{:});

Error in DPARSFA (line 30)
gui_mainfcn(gui_State, varargin{:});

Error while evaluating UIControl Callback.
---------------------------------------------------------------------
If I define TE1 and TE2 in the GUI, I do not need .json files, or?
The magnitude nifti files I started with were originally within the same magnitude file (4D nifti with two components, magnitude1 and magnitude2). I then splitted this 4D nifti file in two single files and put them in the two magnitude folders, but I do not have two distinct .json files.

Thanks for any advise
Regards
Jürgen

Compression will be faster with pigz.exe in the same folder as the executable 
Chris Rorden's dcm2niiX version v1.0.20201102  (JP2:OpenJPEG) (JP-LS:CharLS) MSC1900  (64-bit Windows) 
Warning: only processing last of 5 input files (recompile with 'myEnableMultipleInputs' to recursively process multiple files) 
Error: Input folder invalid: Internship(ISI)\DemoData\DemoRaw\DemoData\T1Raw\Sub_003\0000001.dcm 
Converting T1 Images:Sub_003 OK
Index exceeds the number of array elements (0).
 
Error in DPARSFA_run (line 555)
                        Nii  = nifti(DirImg(1).name);
 
Error in DPARSFA>pushbuttonRun_Callback (line 1847)
    [Error, Cfg]=DPARSFA_run(handles.Cfg);
 
Error in gui_mainfcn (line 95)
        feval(varargin{:});
 
Error in DPARSFA (line 30)
    gui_mainfcn(gui_State, varargin{:});
 
Error using parallel.internal.queue.JavaBackedFuture/waitScalar (line 226)
Error while evaluating UIControl Callback.
 
How to resolve it?
Attachment Size
Capture.JPG 29.5 KB