[vtkusers] Hi, question about vtkMapToWindowLevelColors
Hui Zhang (James)
zhang at isis.imac.georgetown.edu
Tue Jun 8 16:03:39 EDT 2004
Hi,
I encounter some problems in using vtkMapToWindowLevelColors, maybe a little confused how to use it.
What I want to do is: I have a medical image data set (16 bits), and want to use this filter to do window level/width operation, it works well. Now I want to add some new features, for example, mark the CT value range of (500 - 700) to red, but keep other values to their default gray value. So how should I specify the this filter with LUT? Ex: window level/width can be specified to (400, 1000)
m_ImageMap->SetInput( image );
vtkLookupTable* lut = vtkLookupTable::New();
////////////////////////////////////////////////////////////////// how to specify the codes in this section?
lut->SetNumberOfTableValues(256);
//lut->SetHueRange(0.0, 0.0);
//lut->SetSaturationRange(0.0, 0.0);
//lut->SetValueRange(0.0, 1.0);
lut->Build();
for (i = 240; i <= 255; i++)
{
lut->SetTableValue(i, ............... );
}
for (i = 0; i <= 240; i++)
{
lut->SetTableValue(i, .....................);
}
//////////////////////////////////////////////////////////////////////////
m_ImageMap->SetLookupTable(lut);
m_ImageMap->SetLevel( level );
m_ImageMap->SetWindow( width );
m_Actor->SetInput( m_ImageMap->GetOutput() );
Thanks a lot!!!
Hui Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040608/4efa1654/attachment.htm>
More information about the vtkusers
mailing list