[vtkusers] Rendering VTK file bright voxels rendered black

mahsa paknezhad mpaknezhad.2009 at gmail.com
Sat Nov 29 22:13:24 EST 2014

Dear All,

I am rendering a vtk File and I am using the ScalarOpacityFunction to map
the scalar values in the file to different opacity values. The range of
values in the VTK file is [0, 255] and I am  using the following lines of
code to the mapping:

 mitk::StandaloneDataStorage::Pointer ds =
 mitk::DataNode::Pointer node = nodeReader->GetOutput();
 mitk::Image::Pointer image = dynamic_cast<mitk::Image*>(node->GetData());
    node->SetProperty("volumerendering", mitk::BoolProperty::New(true));
    mitk::TransferFunction::Pointer tf = mitk::TransferFunction::New();
    tf->GetScalarOpacityFunction()->AddPoint (0.0, 0.0 );
  tf->GetScalarOpacityFunction()->AddPoint (40.0, 0.0 );
  tf->GetScalarOpacityFunction()->AddPoint (230.0, 0.9 );
    tf->GetScalarOpacityFunction()->AddPoint (255.0, 1.0 );
    node->SetProperty ( "TransferFunction",
mitk::TransferFunctionProperty::New ( tf.GetPointer() ) );
    QmitkRenderWindow renderWindow;
    renderWindow.resize( 256, 256 );

However, there is a problem in the rendering result. The problem is that
the very bright voxels are rendered in black while other voxels are
rendered well. I have checked the file and I am sure that there is no
problem with the values of the voxels that are supposed to be bright (I
mean they really have high values in the range of [0 255]). I also played
with values that I am feeding to the transfer function like setting
mappings for values more than 255 (just in case the scalars in the file
might be more than 255) still no difference. Would you please let me know
what I am doing wrong.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141130/d3d01377/attachment.html>

More information about the vtkusers mailing list