Hi list,

I am trying to highlight a specific voxel range using LevelWindow and
custom LUT function but without any luck. I would like the values between
the [a, b] range to display in red and the values [imgMin, a[ and ]b,
imgMax] to be transparent. The image voxels are scalars.

First, I set my level to (a+b/2.0) and my window to (b-a). I build a custom
LUT that looks like the following

  vtkColorTransferFunction* vtkColorFct = vtkColorTransferFunction::New();
  vtkColorFct->AddRGBSegment(m_LowerBound, 0., 0., 0.,
    lower, 0., 0., 0.);
  vtkColorFct->AddRGBSegment(lower, 1., 0., 0.,
    upper, 1., 0., 0.);
  vtkColorFct->AddRGBSegment(upper, 1., 0., 0.,
    m_UpperBound, 1., 0., 0.);

  vtkPiecewiseFunction* vtkOpacity = vtkPiecewiseFunction::New();
  vtkOpacity->AddPoint(m_LowerBound, 0.);
  vtkOpacity->AddPoint(lower-0.001, 0.);
  vtkOpacity->AddPoint(lower, 1.);
  vtkOpacity->AddPoint(upper, 1.);
  vtkOpacity->AddPoint(upper+0.001, 0.);
  vtkOpacity->AddPoint(m_UpperBound, 0.);

  mitk::LookupTable::Pointer lt = mitk::LookupTable::New();
  lt->CreateColorTransferFunction(vtkColorFct);
  lt->CreateOpacityTransferFunction(vtkOpacity);
  lt->CreateGradientTransferFunction(vtkOpacity);

and set the LookupTable property accordingly. However, it doesn't display
as expected (mostly garbage). I also built another custom LUT using

  vtkSmartPointer<vtkLookupTable> vtkLUT =
vtkSmartPointer<vtkLookupTable>::New();
  vtkLUT->SetTableRange(lower, upper);
  vtkLUT->SetNumberOfTableValues(2);
  vtkLUT->SetTableValue( 0, 0.0, 0.0, 0.0, 0.0 );
  vtkLUT->SetTableValue( 1, 1.0, 0.0, 0.0, 1.0 );
  vtkLUT->Build();

but it also doesn't work because the values higher than upper are clamped
to the maximum display value.

Any hints? Is this the right approach to achieve this?

Regards,
-- 
Félix C. Morency, M.Sc.
Plateforme d’analyse et de visualisation d’images
Centre Hospitalier Universitaire de Sherbrooke
Centre de recherche clinique Étienne-Le Bel
Local Z5-3031 | 819.346.1110 ext 16634
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to