<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&lt;VisualizingImageType&gt; itkVtkConverter;</div><div>itkVtkConverter::Pointer conv=itkVtkConverter::New();</div><div>conv-&gt;SetInput(logic-&gt;visualizing);</div><div><br></div>

<div>vtkVolumeTextureMapper3D *mapper = vtkVolumeTextureMapper3D::New();</div><div>mapper-&gt;SetInput(conv-&gt;GetOutput());</div><div>//rest taken from VTK&#39;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-&gt;SetImportVoidPointer(logic-&gt;visualizing-&gt;GetBufferPointer());</div><div>conv-&gt;SetDataScalarTypeToUnsignedChar();</div>

<div>VisualizingImageType::SizeType size=logic-&gt;visualizing-&gt;GetLargestPossibleRegion().GetSize();</div><div>conv-&gt;SetDataExtent(0,size[0]-1,0,size[1]-1,0,size[2]-1);</div><div>conv-&gt;SetWholeExtent(0,size[0]-1,0,size[1]-1,0,size[2]-1);</div>

<div>conv-&gt;SetDataOrigin(logic-&gt;visualizing-&gt;GetOrigin()[0],</div><div>    logic-&gt;visualizing-&gt;GetOrigin()[1], logic-&gt;visualizing-&gt;GetOrigin()[2]);</div><div>conv-&gt;SetDataSpacing(logic-&gt;visualizing-&gt;GetSpacing()[0],</div>

<div>    logic-&gt;visualizing-&gt;GetSpacing()[1], logic-&gt;visualizing-&gt;GetSpacing()[2]);</div><div><br></div><div>vtkVolumeTextureMapper3D *mapper = vtkVolumeTextureMapper3D::New();</div><div>mapper-&gt;SetInput(conv-&gt;GetOutput());</div>

<div>//rest taken from VTK&#39;s GPURenderDemo.cxx and then simplified</div></div>