We have been discussing this tweet that compares volume rendering in Slicer to the commercial VG Studio software. The question of staircase artifacts came up and thought that the discussion could be of general interest.
Image volumes consists of discrete point samples, which can create two main type of rendering artifacts: staircase artifacts and Moire pattern.
1. Moire pattern on the surface
The pattern looks like elevation lines (points along a line are at equal distance from the camera). The pattern changes as the camera rotates. It is caused by finite sampling distances along the casted ray.
Oversampling (Volume rendering module / Advanced / Techniques / Quality → Maximum) fixes it by taking many samples of a single voxel along the casted ray. There might still remain some visible structured pattern in the image, but that is actually a staircase artifact.
Surface smoothing (a.k.a. jittering, in Volume rendering module / Advanced / Techniques / Surface smoothing) removes the Moire pattern in a clever way, by slightly shifting the starting position of the samples. This replaces the elevation lines by a random noise pattern. Since the number of sampling points remains the same, it does not slow down the rendering.
2. Staircase artifact
Most visible in regions where there are big differences between neighbor slices. Most commonly visible along Z axis, between slices of a CT image. It is caused by insufficient sampling.
The volume renderer assumes that the voxels are samples of a sufficiently densely sampled continuous 3D signal. However, a continuous signal can only be reconstructed from discrete samples if the Shannon-Nyquist sampling criteria is fulfilled (sampling frequency is at least 2x higher than maximum frequency in the image). In CT imaging this criteria is often violated: rate of change between neighbor slices is usually not limited by sampling distance along the Z axis. Not sufficiently dense sampling can cause slight staircase artifacts along other axes, too, typically only visible as slight color patterns (see second image from the top).
Since information is due to insufficient sampling, there is no way to recover all the details of the original signal. However, a bandwidth-limited signal can be reconstructed by applying low-pass filter (e.g., a simple Gaussian smoothing) to ensure the Shannon-Nyquist criteria is not violated. For example, by applying Gaussian smoothing (Simple Filters module / SmoothingRecursiveGaussianImageFilter, Sigma: 0.1, 0.1, 3.0), staircase artifacts are suppressed:
Stronger smoothing can remove all the staircase artifacts but may also remove relevant details from the image.
Next steps
There is room for improvement, for example the Gaussian smoothing could be performed in the GPU on-the-fly and maybe some more sophisticated image reconstruction algorithms could be used instead of Gaussian smoothing (e.g., using deep learning).
However, instead of improving volume raycasting in Slicer, it is probably a better time investment to make VTK’s new physically based rendering surface rendering and evolving photorealistic volume rendering available in Slicer.