-void wxContourMainFrame :: updateActor()
-{
- if (_actorPresent)
- {
- int minMax[2];
- _pannew->onThresholdInstantChange(minMax);
-
- int z = _theViewPanel->GetZ();
-
- vtkImageData * img = getImageData();
- vtkImageReslice *imageReslice = vtkImageReslice::New();
-
- imageReslice->SetInput( img );
- imageReslice->SetInformationInput(img);
- imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
- imageReslice->SetResliceAxesOrigin(0,0,z);
- imageReslice->SetOutputDimensionality(2);
- imageReslice->SetInterpolationModeToLinear();
-
- img = imageReslice->GetOutput();
- img->Update();
- img->UpdateInformation();
-
-//EED??? wxVtkBaseView * baseView = _theViewPanel->getWxVtkBaseView();
-
- double range[2];
- img->GetScalarRange(range);
-
- int min = floor (range[0]);
- int max = ceil (range[1]);
-
- //Lookup Table
- vtkLookupTable *lookup = vtkLookupTable::New();
- lookup->SetNumberOfTableValues(max+1);
- lookup->SetTableRange(range);
- lookup->SetAlphaRange(0, 1);
- lookup->SetValueRange(0, 1);
- lookup->SetSaturationRange(0, 0);
- lookup->SetRampToLinear( );
-
- //Assign a fake color for the upper image, and set the white as transparent
- int i;
- int minVal = minMax[0];
- int maxVal = minMax[1];
-
- for(i = min; i <= max; i++)
- {
- if( i >= minVal && i <= maxVal )
- {
- lookup->SetTableValue(i, 1.0, 0.0, 0.0, 1);
- }
- else if( i >= min && i < minVal )
- {
- lookup->SetTableValue(i, 1.0, 1.0, 1.0, 0); //transparent
- }
- else if( i > maxVal && i < max )
- {
- lookup->SetTableValue(i, 1.0, 1.0, 1.0, 0); //transparent
- }
- else
- {
- lookup->SetTableValue(i, 1.0, 1.0, 1.0, 0); //transparent
- }
- }
-
- lookup->Build( );
-
- vtkImageMapToColors *mapperImage = vtkImageMapToColors::New( );
- mapperImage->SetLookupTable( lookup );
- mapperImage->SetInput( img );
- //mapperImage->SetOutputFormatToRGBA( );
-
- _thresholdActor->SetInput( mapperImage->GetOutput() );
- printf("EED wxContourMainFrame::updateActor %d \n" , z);
- _thresholdActor->SetPosition( 0,0, 900-1 );
- }
-}