[Insight-users] LabelMaps Handling and Colouring
Adrian Friebel Work
friebel at izbi.uni-leipzig.de
Thu Sep 22 13:52:56 EDT 2011
Hi,
I have some questions, regarding the LabelMaps/Objects and their
functionalities. I am not sure, if the solutions, that I see for my
problem, are okay, or if their are better ways to do what I want.
Here is my problem:
After some preprocessing on the (separated) three color channels of an
RGB image, I used the BinaryImageToShapeLabelMapFilter on the red
channel to get a LabelMap of the objects of interest. I used shape
opening to remove the biggest and smallest objects. To this point
everything looks nice.
Now, I want to distinguish these LabelObjects into two classes, based on
the binarized values in the (at this stage separated) blue channel.
After this, I want to generate an RGB overlay image of the original
image (grey scale) and the two different LabelObject classes. At best,
with two different colours for the two different LabelObject classes. (I
used the LabelOverlayImageFilter to overlay the original image with all
LabelObjects, which worked fine)
So, I thought about, to convert the ShapeLabelMap to an
AttributeLabelMap. Then I could look for example at their centroid point
in the blue channel image and based on this, I set my LabelObject
attribute value to true or false. (Similar to the
BinaryReconstructionLabelMapFilter, I guess) But is it possible, to use
the Attribute values, to generate the colour for the overlay?
The second way to go, that I see, is, to create a second LabelMap and
copy the LabelObjects with blue at their centroid point to this new
LabelMap and delete them from the old. (I tried this, but my application
crashed during usage of functions like LabelObject->CopyAllFrom(obj) and
LabelMap->RemoveLabelObject(obj)). Is this possible in principle, how
can I copy and delete LabelObjects to/from LabelMaps? And if I have the
two LabelMaps, is it possible to lay them both over the input image and
give the LabelObjects of the two different LabelMaps two different colours?
I would be grateful for some hints and approach sketches,
thanks in advance,
Adrian.
More information about the Insight-users
mailing list