[vtk-developers] proposed ENH to vtkImagePlaneWidget
Dean Inglis
dean.inglis at on.aibn.com
Fri Aug 2 10:01:55 EDT 2002
Hi all,
I can add a couple of lines to vtkImagePlaneWidget in
::GenerateTexturePlane() that
will enable transparency:
<snip>
this->ColorMap->SetLookupTable(this->LookupTable);
this->ColorMap->SetOutputFormatToRGBA();
this->ColorMap->PassAlphaToOutputOn();
<snip>
and further down:
<snip>
this->Texture->SetQualityTo32Bit();
if ( this->GrayScaleEnabled )
{
this->Texture->MapColorScalarsThroughLookupTableOff();
}
else
{
this->Texture->MapColorScalarsThroughLookupTableOn();
}
this->Texture->SetInterpolate(this->TextureInterpolate);
this->Texture->RepeatOff();
this->Texture->SetLookupTable(this->LookupTable);
<snip>
where GrayScaleEnabled is an ivar accessable through the API.
Then, for example, one could either build a vtkLookupTable, and
set it to the widget or retrieve the widget's internal lut:
lut = widget->GetLookupTable();
lut->SetValue(0,0,0,0,0);
to make voxels of value '0' invisible. The only problem(?) may
be with any subsequent window-levelling.
Any thoughts? Should GrayScaleEnabled be changed to
TransparencyEnabled or something else?
Dean
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dean Inglis, Ph.D.
Clinical Research Unit
25 Charlton Avenue East, Unit 610
Hamilton, ONT, L8N 1Y2
tel: (905) 527-0028
fax: (905) 521-1297
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
More information about the vtk-developers
mailing list