Why do I get the error message with "more non-singleton rhs dimensions"?
1 view (last 30 days)
Show older comments
So I have this loop that works very well and fills comp with differences between images BW_vtk and BW_groundtruth. They are both 448x448x80 logical.
for k = 1:size(BW_vtk,3)
comp(:,:,k) = imfuse(BW_vtk(:,:,k), BW_groundtruth(:,:,k),'diff');
end
If I change it to this:
for k = 1:size(BW_vtk,3)
comp(:,:,k) = imfuse(BW_vtk(:,:,k), BW_groundtruth(:,:,k),'falsecolor');
end
I get the error message: Assignment has more non-singleton rhs dimensions than non-singleton subscripts
I don't understand why. It would be much nicer in falscolor. How can I fix it?
0 Comments
Accepted Answer
dpb
on 31 Oct 2018
comp=imfuse(BW_vtk, BW_groundtruth,'falsecolor');
Method 'diff' returns a single value the difference so can be applied on a plane-by-plane basis but 'falsecolor' returns a RGB image which is three planes so can't store all three planes in a single plane; just work on the image as a whole.
More Answers (0)
See Also
Categories
Find more on Logical 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!