[Insight-users] ScalarToRGBPixelFunctor maps too similar colors when label number is small

Luis Ibanez luis.ibanez at kitware.com
Tue May 24 11:52:51 EDT 2005



Hi Xiong


This Functor generate a hash table of colors
and associate them to the input labels.

The algorithm is intended to deal with large
numbers of labels, and it is based on using the
low bits of the label in order to chose the colors.


The output RGB values are controled by a hashing
scheme that uses the individual bytes of the
input label.


You may want to "retouch" the hashing scheme,
or simply resort your labels so they don't have
close numerical values.


Note that this is an Ill-posed problem. There is
not a clear way to guarrantee that colors will
be different enough.

The formal way in which this could be done in
colorimetry is by taking the N labels that you
need and throwing them in RGB space using a
code-spreading algorithm.  You will find such
algorithms described in texts such as Graphic
Gems, and if you want to go to the powerful
and sophisticated ones, you could go for

"Sphere Packing Lattice and Groups"
by Convway and Sloane
Springer Verlag
1993
http://www.amazon.com/exec/obidos/ASIN/0387985859/qid=1116949852/sr=2-1/ref=pd_bbs_b_2_1/104-5891421-3507160




Please let us know if you have further questions,


    Thanks


       Luis



--------------------------------------------------
??? wrote:

> hi all,
>     I use ScalarToRGBPixelFunctor to map labels to colors. When label number
> is large, about several hundreds, it is good. But when label number is small,
> about several tens, it map to similar colors, most of green. Why?
>                                                  bear
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 





More information about the Insight-users mailing list