Volume Rendering not working with NRRD files with negative space direction


I am attempting to use the VTK SmartVolumeMapper to render an NRRD file. While this works well for most of my test files, I have encountered issues with some NRRD files that have negative space directions (e.g. space directions: (-0.30000000000000004,0,0) (0,-0.30000000000000004,0) (0,0,-0.30000000000000004)). When I try to render these files, nothing appears on the screen.

I’m not sure if this is a known issue with VTK Volume Rendering or if I’m doing something wrong. I am using the vtkSmartVolumeMapper with Composite blend mode and GPU rendering enabled. For the volume properties, I use nearest interpolation and I set a color and opacity for each of my NRRD intensities (mostly 0-7 or 0-6).

Maybe someone can help me with this issue?

I have no experience with NRRD files (or much with volume rendering for that matter) - but perhaps try generating an isosurface and plotting that? If the isosurface works out, you can assume that the NRRD file was read in correctly, and perhaps isolate the issue to smart volume mapper?

Having some axes with negative vector components are not a problem at all. The issue with this direction matrix is that it’s determinant is negative, so it makes the image axes to form a left-handed coordinate system.

I would recommend to double-check the source of this image, as left-handed coordinate systems are rarely used in medical imaging. If you are sure that it is correct then you can fix it by reversing the order of image slices and inverting the direction vector of the third image axis.

I forgot to mention that, with FlyingEdges3D and a PolyDataMapper it all works fine. So the issue is definitely with the volume mapper. Using isosurface rendering is not an option though, because the generating of the polygons takes too long.