std::vector<double> base_color = bbGetInputlstBaseColor();
std::vector<double> grey_level_boundaries = bbGetInputlstGreyLevelBoundaries();
std::vector<double> transparence_level_boundaries = bbGetInputlstTransparenceBoundaries();
-
clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 0 , bbGetInputWxVtkBaseView() );
clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 1 , bbGetInputWxVtkBaseView1() );
clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 2 , bbGetInputWxVtkBaseView2() );
clivp->GetColorLayerImageViewManager()->SetPlainOrGradientColor( bbGetInputPlainOrGradientColor() );
clivp->SetFittingMode( bbGetInputFittingMode() );
clivp->SetImage( bbGetInputIn() );
-
+
bbSetOutputNewImage( clivp->GetColorLayerImageViewManager()->GetImageChangeInformation(0) );
bbSetOutputLookupTable( clivp->GetColorLayerImageViewManager()->GetLookupTable(0) );
bbSetOutputOutOpacity( clivp->GetOpacity() );
//----------------------------------------------------------------------------
void ColorLayerImageView::ConfigLookupTable() // virtual
{
-
// CM 2014
// EED 28/01/2015
// Grey level extrema retrieved from the image grey level extrema.
{
//EED std::cout << "CM ColorLayerImageView::ConfigLookupTable : ERROR!!! Inconsistency between the sizes of vectors _base_color and _grey_level_boundary. _base_color.size()/3 (=" <<_base_color.size()/3 << ") should be equal to _grey_level_boundary.size()+1 (=" << _grey_level_boundary.size()<<"+1)." << std::endl;
//EED std::cout << "CM The default values for the base colors and the grey level boundaries will be set." << std::endl;
- SetDefaultGreyLevelBoundary();
- } // if
+ SetDefaultGreyLevelBoundary();
+ } // if
} // _color_type
if (_color_type==false) // Gradiant
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.
}// for
} //if
} // End Of if (!_color_type)
-
+
double minRangeForColorBar, maxRangeForColorBar;
GetRangeForColorBar( minRangeForColorBar, maxRangeForColorBar );
thresholdTable->SetRange( minRangeForColorBar, maxRangeForColorBar );
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
- GetImage()->Update();
+ GetImage()->Update();
#else
//...
#endif
//EED 20 oct 2015
// GetImage()->GetScalarRange(_range);
- GetImageScalarRange();
-
- double minRange = _range[0];
- double maxRange = _range[1];
- return maxColorsThresholdTable * (VALUE-minRange) / (maxRange-minRange);
+ GetImageScalarRange();
+ double minRange = _range[0];
+ double maxRange = _range[1];
+
+ if (maxRange==minRange)
+ {
+ return 0;
+ } else {
+ return maxColorsThresholdTable * (VALUE-minRange) / (maxRange-minRange);
+ }
}
//----------------------------------------------------------------------------
void ColorLayerImageView::FillColorTable(int start, int end, double r1, double g1, double b1, double r2, double g2, double b2, double t1, double t2)
{
- vtkLookupTable* thresholdTable = GetThresholdTable();
+ vtkLookupTable* thresholdTable = GetThresholdTable();
int iTable;
double delta = end-start;
double dr = (r2-r1)/delta;
{
thresholdTable->SetTableValue( iTable+start , r1+dr*iTable, g1+dg*iTable, b1+db*iTable,t1+dt*iTable);
} // for iTable
-
-
}
// EOF
directionViewer = wxvtk2dbasevie->GetDirection();
} // ParallelProjection
-
if (!GetActorPresent())
{
if (_thresholdTable==NULL)
_thresholdActor->SetPosition( 0,0, -900-1 );
}
} // _thresholdActor
+
_baseView->GetRenderer()->AddActor( _thresholdActor );
_baseView->GetRenderer()->AddActor2D( _scalarbarActor );
_actorPresent = true;
_thresholdMapper->Update();
_thresholdActor->SetInputData( _thresholdMapper->GetOutput() );
#endif
-
+
_thresholdActor->SetOpacity(_opacity);
_scalarbarActor->SetLookupTable( _thresholdTable );
// _scalarbarActor->SetLookupTable( _thresholdMapper->GetLookupTable() );
_scalarbarActor->GetLabelTextProperty()->SetFontSize(fontsize/2);
// _scalarbarActor->SetTextPad(4); ??
} // if _image
-
}
-
-
//----------------------------------------------------------------------------
void LayerImageBase::onThresholdChange()
{