Why do I get the error message with "more non-singleton rhs dimensions"?

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?

 Réponse acceptée

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.

1 commentaire

Petr Vorel
Petr Vorel le 1 Nov 2018
Modifié(e) : Petr Vorel le 1 Nov 2018
Thank you. I guess this answers my question but it produces another problem. The input to 'falsecolor' has to be either MxN och MxNx3 array and the output is MxNx3. So it seems it won't work anyway.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Produits

Version

R2017b

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by