- ii=i-minTot;
- if ((ii>=delta0) && (ii<=delta1)) // iBlue
- {
- thresholdTable->SetTableValue( i , 0 , 0 , iBlue/delta , 1);
- if (ii==0)
- {
- thresholdTable->SetTableValue( i , 0 , 0 , iBlue/delta , 0);
- } else {
- thresholdTable->SetTableValue( i , 0 , 0 , iBlue/delta , 1);
- }
- iBlue++;
- }
- if ((ii>=delta1) && (ii<=delta2)) // iYellow
+ _transparence_level_boundary.push_back(1);
+ }
+
+
+ // ------------------ Defining the Threshold Table
+ vtkLookupTable* thresholdTable = GetThresholdTable();
+
+ double thresholdTable_range[2];
+ double r1,r2,g1,g2,b1,b2,t1,t2;
+ int start,end;
+
+ // CM Number of table values consistent with the effective number of values (see loop below).
+ thresholdTable_range[1]= std::max( GetGreyLevelBoundaries( _grey_level_boundary.size()-1 ) , ceil(maxRange) );
+ thresholdTable_range[0]= std::min( GetGreyLevelBoundaries(0), floor(minRange) );
+
+ thresholdTable_range[1]= GetGreyLevelBoundaries( _grey_level_boundary.size()-1 );
+ thresholdTable_range[0]= GetGreyLevelBoundaries(0);
+
+ thresholdTable->SetTableRange(thresholdTable_range);
+ thresholdTable->SetAlphaRange( 0,1 );
+ thresholdTable->SetValueRange( 0,1 );
+
+ thresholdTable->SetSaturationRange( 0,0 );
+ thresholdTable->SetRampToLinear( );
+
+ maxColorsThresholdTable = 1000;
+ thresholdTable->SetNumberOfTableValues( maxColorsThresholdTable+1 );
+ thresholdTable->SetNanColor(0,0,0,0);
+
+
+ // Defines the lookup table.
+ // If the image has a degradation in one (or both) extremum (lower or higher),
+ // sets the corresponding grey levels as transparent white in the lookup table.
+
+ // _color_type true, i.e. plain colors.
+ // Sets the plain color for each grey level interval.
+ if (_color_type) // Plain
+ {
+ if ( minRange<GetGreyLevelBoundaries(0) )
+ {
+ start = 0;
+ end = GrayLevel_TO_colorTableIndex( GetGreyLevelBoundaries(0) );
+ FillColorTable(start,end, 0,0,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, 0,0);
+ }
+ for (int iColor = 0; iColor < GetBaseColorNb(); iColor++)