Error with standardization tool and image calculater when trying to z-standardise


I was playing a little bit with the standardization tool and wanted to z-standardize some nifti files I created. I got the following error:


Writing to files...
Attempted to access TempIndex(0); index must be a positive integer or logical.

Error in y_Standardization (line 219)
    [status,message,messageid] = mkdir(fullfile(OutputDir,[Path(TempIndex(end)+1:end),Suffix]));

Error in DPABI_Standardization>ComputeButton_Callback (line 213)
[StandardizedBrain, Header] = y_Standardization(ImgCells, MaskFile, MethodType, OutputDir, Suffix);

Error in gui_mainfcn (line 96)

Error in DPABI_Standardization (line 42)
    gui_mainfcn(gui_State, varargin{:});

Error in @(hObject,eventdata)DPABI_Standardization('ComputeButton_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating uicontrol Callback

I tried it with some unstandardized ReHo images from the preprocessing, but get the same error.

Then I tried to use the Image calculator to z-standardise the images. I loaded all the images on the left side as g1 and the single images on the right side. I used the formular specified in the help: (i1-mean(g1))./std(g1). Then I got the following error.

Error using fprintf
Function is not defined for 'cell' inputs.

Error in DPABI_CALCULATOR_TOOL>ComputeButton_Callback (line 312)
    fprintf('%s: %s\n', GroupLabel{j}, GroupCells{j});

Error in gui_mainfcn (line 96)

Error in DPABI_CALCULATOR_TOOL (line 42)
    gui_mainfcn(gui_State, varargin{:});

Error in @(hObject,eventdata)DPABI_CALCULATOR_TOOL('ComputeButton_Callback',hObject,eventdata,guidata(hObject))


H0w did you set up the specifications in Standardization GUI?

I just tested, if adding a directory, using Z-standardization, the running is fine.



I tested it with 16 wRehomaps and a 90% Groupmask , see the following picture:

this time with spm8, but same error.

Hi David,

I think there is a bug in y_Standardization.m under windows (I use a mac). Could you help to revise Line 218


TempIndex = strfind(Path,'/');


TempIndex = strfind(Path,filesep);

Please have a try and let me know if this problem has been fixed.






Works now :)..thanks!!!

The problem with the image calculator still exists though. Forgot to mention, I'm using Windows 7.