[vtkusers] ImageToVTKImageFilter crashes during interaction

Dženan Zukić dzenanz at gmail.com
Wed Jan 19 08:32:41 EST 2011


Hi all,

I am switching from OpenSceneGraph library to VTK because of missing support
for mixing volume rendering and polygonal rendering in OSG.

When using ImageToVTKImageFilter, the program crashes when I try to rotate
view, resize window etc. When using vtkImageImport directly, it works fine.
Crash info:
Unhandled exception at 0x0000000219930522 in Spine.exe: 0xC0000005: Access
violation at location 0x0000000219930522.
debugger breask in
\InsightToolkit-3.20.0\Code\BasicFilters\itkVTKImageExportBase.cxx, on line
189

If I use vtkGPUVolumeRayCastMapper instead of vtkVolumeTextureMapper3D
(vtkVolumeTextureMapper2D also crashes the same), there is no chash using
either ImageToVTKImageFilter or vtkImageImport.

What is the problem, and which mapper is the recommended one? I have recent
hardware.

Regards,
Dženan

//ImageToVTKImageFilter version of the code:
typedef itk::ImageToVTKImageFilter<VisualizingImageType> itkVtkConverter;
itkVtkConverter::Pointer conv=itkVtkConverter::New();
conv->SetInput(logic->visualizing);

vtkVolumeTextureMapper3D *mapper = vtkVolumeTextureMapper3D::New();
mapper->SetInput(conv->GetOutput());
//rest taken from VTK's GPURenderDemo.cxx and then simplified


//vtkImageImport version of the code:
vtkImageImport *conv=vtkImageImport::New();
conv->SetImportVoidPointer(logic->visualizing->GetBufferPointer());
conv->SetDataScalarTypeToUnsignedChar();
VisualizingImageType::SizeType
size=logic->visualizing->GetLargestPossibleRegion().GetSize();
conv->SetDataExtent(0,size[0]-1,0,size[1]-1,0,size[2]-1);
conv->SetWholeExtent(0,size[0]-1,0,size[1]-1,0,size[2]-1);
conv->SetDataOrigin(logic->visualizing->GetOrigin()[0],
    logic->visualizing->GetOrigin()[1], logic->visualizing->GetOrigin()[2]);
conv->SetDataSpacing(logic->visualizing->GetSpacing()[0],
    logic->visualizing->GetSpacing()[1],
logic->visualizing->GetSpacing()[2]);

vtkVolumeTextureMapper3D *mapper = vtkVolumeTextureMapper3D::New();
mapper->SetInput(conv->GetOutput());
//rest taken from VTK's GPURenderDemo.cxx and then simplified
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110119/4461ad8f/attachment.htm>


More information about the vtkusers mailing list