- if (_imageReslicer==NULL)
- {
- _imageReslicer = vtkImageReslice::New();
- _imageReslicer->SetInput( img );
- _imageReslicer->SetInformationInput(img);
- _imageReslicer->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
- _imageReslicer->SetOutputDimensionality(2);
- _imageReslicer->SetInterpolationModeToLinear();
- }
-
- _imageReslicer->SetResliceAxesOrigin(0,0,z);
-
- img = _imageReslicer->GetOutput();
- img->Update();
- img->UpdateInformation();
-
- wxVtkBaseView *baseView = _baseView;
-
- if (_thresholdTable==NULL)
- {
- //Lookup Table
- _thresholdTable = vtkLookupTable::New();
- _thresholdTable->SetNumberOfTableValues(maxTot+1);
- _thresholdTable->SetTableRange(range);
- _thresholdTable->SetAlphaRange(0, 1);
- _thresholdTable->SetValueRange(0, 1);
- _thresholdTable->SetSaturationRange(0, 0);
- _thresholdTable->SetRampToLinear( );
- }
-
- //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( );
-
- if (_thresholdMapper==NULL)