Array dimensions must match for binary array op.
Show older comments
I have two groups of images (patients and control subjects) and I am try to perform a two sample t-test but I keep getting this error ''Array dimensions must match for binary array op.'' even though I checked the dimensions of all my images are they are the same (x=46, y=55, and z=46) and their sizes to are the same (voxel size= 3 x 3 x 3). Please I really need help to solve this problem. I am confused as to what array dimensions they are talking about.
Error in y_GroupAnalysis_Image (line 60)
MaskData = any(DependentVolume,4) .* MaskData; % skip the voxels with all zeros
Error in y_TTest2_Image (line 84)
[b_OLS_brain, t_OLS_brain, TTest2_T, r_OLS_brain, Header] =
y_GroupAnalysis_Image(DependentVolume,Regressors,OutputName,MaskFile,CovariateVolume,Contrast,'T',0,Header);
Error in DPABI_STAT_TOOL>ComputeButton_Callback (line 521)
y_TTest2_Image(S, OutputName, MaskFile, ImageCell, TextCell, PALMSettings);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in DPABI_STAT_TOOL (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)DPABI_STAT_TOOL('ComputeButton_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
3 Comments
Mehmed Saad
on 17 Apr 2020
Error in y_GroupAnalysis_Image (line 60)
MaskData = any(DependentVolume,4) .* MaskData; % skip the voxels with all zeros
what is initial value of MaskData?
put a break point on this line and see the size of any(DependentVolume,4) and MaskData
Tommy
on 17 Apr 2020
MaskData = any(DependentVolume,4) .* MaskData;
The error message indicates that the problem is in this line. Can you be sure that the result of any(DependentVolume,4) has the same number of elements as MaskData?
Elijah Agoalikum
on 17 Apr 2020
Answers (0)
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!