- {
- for (int i = 0; i < GetBaseColorNb(); i++)
- {
- delta = GetGreyLevelBoundaries(i+1) - GetGreyLevelBoundaries(i);
- for (int ii = 1; ii <= delta; ii++)
- {
- thresholdTable->SetTableValue(GetGreyLevelBoundaries(i) + ii,
- GetBaseColors(i*3),
- GetBaseColors(i*3 + 1),
- GetBaseColors(i*3 + 2),
- 1);
- }
- }
- } // End Of if (_color_type)
+ {
+
+ if ( minRange<GetGreyLevelBoundaries(0) )
+ {
+ start = 0;
+ end = GrayLevel_TO_colorTableIndex( GetGreyLevelBoundaries(0) );
+ FillColorTable(start,end, 0,0,0, 0,0,0);
+ }
+
+ if ( maxRange>GetGreyLevelBoundaries( _grey_level_boundary.size()-1 ) )
+ {
+ start = GrayLevel_TO_colorTableIndex( GetGreyLevelBoundaries( _grey_level_boundary.size()-1 ) );
+ end = GrayLevel_TO_colorTableIndex( maxRange );
+ FillColorTable(start,end, 0,0,0, 0,0,0);
+ }
+
+ for (int iColor = 0; iColor < GetBaseColorNb(); iColor++)
+ {
+ r1 = GetBaseColors(iColor*3+0);
+ g1 = GetBaseColors(iColor*3+1);
+ b1 = GetBaseColors(iColor*3+2);
+ start = GrayLevel_TO_colorTableIndex( GetGreyLevelBoundaries(iColor) );
+ end = GrayLevel_TO_colorTableIndex( GetGreyLevelBoundaries(iColor+1) );
+ FillColorTable(start,end, r1,g1,b1,r1,g1,b1);
+ } // for i
+ } // End Of if (_color_type)