I have an image with red, green, blue channel and a binary version of the image.
What I want to do is concatenate those 2 images so that the binary image works as th
You can use the binary image as a logical index in the 3dim image. To zero all pixels in image that are zero in the binary mask, you can use the following code for each dimension: image(~mask)=0;
image
mask
image(~mask)=0;