<div><div>Hi all,</div><div><br></div><div>I am switching from OpenSceneGraph library to VTK because of missing support for mixing volume rendering and polygonal rendering in OSG.</div><div><br></div><div>When using ImageToVTKImageFilter, the program crashes when I try to rotate view, resize window etc. When using vtkImageImport directly, it works fine. Crash info:</div>
<div><div>Unhandled exception at 0x0000000219930522 in Spine.exe: 0xC0000005: Access violation at location 0x0000000219930522.</div><div>debugger breask in \InsightToolkit-3.20.0\Code\BasicFilters\itkVTKImageExportBase.cxx, on line 189</div>
</div><div><br></div><div>If I use vtkGPUVolumeRayCastMapper instead of vtkVolumeTextureMapper3D (vtkVolumeTextureMapper2D also crashes the same), there is no chash using either ImageToVTKImageFilter or vtkImageImport.</div>
<div><br></div><div>What is the problem, and which mapper is the recommended one? I have recent hardware.</div><div><br></div><div>Regards,</div><div>Dženan</div><div><br></div><div>//ImageToVTKImageFilter version of the code:</div>
<div>typedef itk::ImageToVTKImageFilter<VisualizingImageType> itkVtkConverter;</div><div>itkVtkConverter::Pointer conv=itkVtkConverter::New();</div><div>conv->SetInput(logic->visualizing);</div><div><br></div>
<div>vtkVolumeTextureMapper3D *mapper = vtkVolumeTextureMapper3D::New();</div><div>mapper->SetInput(conv->GetOutput());</div><div>//rest taken from VTK's GPURenderDemo.cxx and then simplified</div><div><br></div>
<div><br></div><div>//vtkImageImport version of the code:</div><div>vtkImageImport *conv=vtkImageImport::New();</div><div>conv->SetImportVoidPointer(logic->visualizing->GetBufferPointer());</div><div>conv->SetDataScalarTypeToUnsignedChar();</div>
<div>VisualizingImageType::SizeType size=logic->visualizing->GetLargestPossibleRegion().GetSize();</div><div>conv->SetDataExtent(0,size[0]-1,0,size[1]-1,0,size[2]-1);</div><div>conv->SetWholeExtent(0,size[0]-1,0,size[1]-1,0,size[2]-1);</div>
<div>conv->SetDataOrigin(logic->visualizing->GetOrigin()[0],</div><div> logic->visualizing->GetOrigin()[1], logic->visualizing->GetOrigin()[2]);</div><div>conv->SetDataSpacing(logic->visualizing->GetSpacing()[0],</div>
<div> logic->visualizing->GetSpacing()[1], logic->visualizing->GetSpacing()[2]);</div><div><br></div><div>vtkVolumeTextureMapper3D *mapper = vtkVolumeTextureMapper3D::New();</div><div>mapper->SetInput(conv->GetOutput());</div>
<div>//rest taken from VTK's GPURenderDemo.cxx and then simplified</div></div>