-
- _thresholdMapper->SetLookupTable( _thresholdTable );
- _thresholdMapper->SetInput( img );
-
- if (_thresholdActor==NULL)
- {
- _thresholdActor = vtkImageActor::New( );
- _thresholdActor->SetOpacity( 0.6 );
- _thresholdActor->InterpolateOn( );
- _thresholdActor->SetPosition( 0,0, 900-1 );
- }
-
- _thresholdActor->SetInput( _thresholdMapper->GetOutput() );
-
- baseView->GetRenderer()->AddActor( _thresholdActor );
- _actorPresent = true;
- }
-
- else
- {
- _imageReslicer->SetResliceAxesOrigin(0,0,z);
- img = _imageReslicer->GetOutput();
- img->Update();
- img->UpdateInformation();
-
- //Assign a fake color for the upper image, and set the white as transparent
- int i;
- for(i = minTot; i <= maxTot; i++)
- {
- if( i >= minVal && i <= maxVal )
- {
- _thresholdTable->SetTableValue(i,_baseColorR,_baseColorG,_baseColorB, 1);
- }
- else if( i >= minTot && i < minVal )
- {
- _thresholdTable->SetTableValue(i, 1.0, 1.0, 1.0, 0); //transparent
- }
- else if( i > maxVal && i < maxTot )
- {
- _thresholdTable->SetTableValue(i, 1.0, 1.0, 1.0, 0); //transparent
- }
- else
- {
- _thresholdTable->SetTableValue(i, 1.0, 1.0, 1.0, 0); //transparent
- }
- }
-
- _thresholdTable->Build( );
- _thresholdMapper->SetLookupTable( _thresholdTable );
- _thresholdMapper->SetInput( img );
- _thresholdActor->SetInput( _thresholdMapper->GetOutput() );
- }
-}
-
-
-//----------------------------------------------------------------------------
-void ThresholdImageView::onThresholdChange()
-{
- if (_actorPresent)
- {
- onThreshold();
- }
-}
-
-//----------------------------------------------------------------------------
-void ThresholdImageView::onThresholdInterpolation(bool interpolate)
-{
- if (_thresholdActor!=NULL)
- {
- if (interpolate)
- {
- _thresholdActor->InterpolateOn( );
- }
-