Borrar filtros
Borrar filtros

ROI colour change

1 visualización (últimos 30 días)
M M
M M el 13 de Jun. de 2011
I am wondering if anyone knows how I can change the output colour of an roi?
outlineMat = outlineMat + roipoly(zerosMat,x,y)
is there a function to add onto roipoly that will allow me to change it's output colour when I run the program? right now what I get is a black background and the roi in white.

Respuestas (1)

Walter Roberson
Walter Roberson el 13 de Jun. de 2011
roipoly creates a 2D mask, and 2D images are either black and white, grayscale, or pseudo-color. If the result you get is pseudocolor, you could adjust the color map so that the high values mapped to color, but then all the high values would map to color, including ones that were already high in outlineMat.
What you could do, if you do not need to do further grayscale processing, so something like,
roi = roipoly(zerosMat,x,y);
outlineMatC(:,:,1) = outlineMat + R * roi;
outlineMatC(:,:,2) = outlineMat + G * roi;
outlineMatC(:,:,3) = outlineMat + B * roi;
where R, G, and B are the appropriate color components of the color you want the ROI to become.
Yes, this could be shortened to one or two lines, but they are not going to be immediately understandable
roi = roipoly(zerosMat,x,y);
outlineMatC = repmat(outlineMat,1,1,3) + cat(3, R*roi, G*roi, B*roi);
Sometimes clarity is best.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by