I am trying to create an RGB label fragment using label2rgb and use it to update the RGB volume, for example:
labelRGB_slice=label2rgb(handles.label(:,:,handles.current_slice_z), 'jet', [0 0 0]); handles.labelRGB(:,:,handles.current_slice_z) = labelRGB_slice;
I get the following error:
**Assignment has more non-singleton rhs dimensions than non-singleton subscripts** Error in Tesis_GUI>drawSeedButton_Callback (line 468) handles.labelRGB(:,:,handles.current_slice_z) = labelRGB_slice;
When debugging, I get the following:
size(labelRGB_slice) ans = 160 216 3 K>> size(handles.labelRGB(:,:,handles.current_slice_z) ) ans = 160 216
I declared handleles.labelRGB as follows:
handles.labelRGB = zeros(dim(1), dim(2), dim(3), 3);
Therefore, I do not understand the inequality of the index.
How can I complete the slice assignment?
source share