Stitching artifact with volume rendering

Hi! I’ve ran into some problems with Radeon RX 6900 XT graphic card, Ryzen9 5900X, 128G RAM, using slicer versions 4.11.20210226 and 4.13.0-2021-12-01.

The volumes seem to have stiched in wrong orders in 3D. There is no problem using Nvidia graphic cards 3090, 1080Ti and 1070 using same settings opening same files.

Another issue is regarding 3D volume rendering of different file sizes. The file shown in figure is around 11Gb. Certain files around 4-8Gb can not be rendered, nothing is shown in the 3D window when the volume rendering eye is clicked. Same is with all files I’ve tried between 12-16Gb. The same files are fine when rendered in Nvidia cards 3090 and 1080Ti. 3090 can render files larger than 24Gb.

Many thanks!

Best regards
Hao Li

Thanks for reporting, it can be hard to know when mixing different hardware and drivers will lead to trouble, particularly for large datasets where hardware limits might come into play. In this case it might be the dimensions of the volumes - maybe volumes that pass certain sizes in one dimension lead to this kind of issue.

Slicer delegates volume rendering to VTK, so the best way to document and perhaps fix these issues is to supply pure-VTK scripts and sample data the VTK developers with information about how to replicate the issues (exactly which card/driver combinations lead to the issues). See this thread for a somewhat similar issue. The issues may be fixable or they may at least be detectable so the user is warned of possible failure modes.

In the mean time, probably best is to use the CropVolume module to either resize or subset the volume of interest so that it can be rendered on the available hardware.

Stitching artifacts while rendering large volumes AMD GPUs can be solved by adjusting the number of partitions by copy-pasting a few lines of Python code as shown here:

I would recommend to go with NVidia if you need to render large volumes. Either AMD drivers are lower quality, or maybe NVidia drivers are just as bad but VTK is tested more with NVidia and so VTK contains more fixes or workarounds for NVidia bugs.

Hi!

Thank you for reply!
Maybe it was a mistake to buy AMD graphic card, all Nvidia ones were sold out :S.

Sorry to bother you again. I’m not very technical, I’ve copied and pasted the lines in the Python Interactor and got a few red messages… I’m sure I’ve missed something there…

Regarding large volumes, I suppose it depends on pixels/voxels? The scan I’m working with is a small cube around 20 x 20 x 20mm.

Warmest regards from Uppsala Sweden

The line right above the line generating the error is incomplete. You need something like this:

vrMapper = vrDisplayableManager.GetVolumeMapper(getNode('1637L_9um_PR1000'))

whereas you have this:

vrMapper = vrDisplayableManager.GetVolumeMapper

Give that a try!

2 Likes

And in terms of volume size we mean pixels, not physical units. Look at the Dimensions in the Volumes module under Volume Information

Hi! Thank you for the replies!

I have tried, without understanding what I did …

vrMapper = vrDisplayableManager.GetVolumeMapper(getNode(‘1637L_9um_PR1000’))
vrMapper.SetPartitions(2,2,2)
vrMapper.SetPartitions(4,4,4)
vrMapper.SetPartitions(1,1,4)
vrMapper.SetPartitions(1,1,2)
vrMapper.SetPartitions(1,2,2)
vrMapper.SetPartitions(2,2,1)
vrMapper.SetPartitions(4,2,1)
vrMapper.SetPartitions(4,2,2)
vrMapper.SetPartitions(3,2,2)
vrMapper.SetPartitions(3,2,2)
vrMapper.SetPartitions(3,2,1)

And clicked on the “eye” button a few times in between, nothing seemed to have changed :dizzy_face:

My image dimensions are 1950 x 1830 x 1600.

Are there are other saves I can try?

Best regards
Hao Li

You could try cropping or resizing to see what sizes work, and see if you can work with any resolution loss. You might also be able to crop into two pieces and use the multivolume mode to show both, but there will probably be as seam where they abut.

When there’s a volume rendering issue like this it’s probably in the VTK layer. Best way to work towards a fix is to share a pure-VTK example that demonstrates the issue clearly and post it as a VTK issue. As a rule the VTK community wants everything to work well, but hardware/driver issues are known to be very hard to fix. Maybe there’s a workaround that could be applied in Slicer.

You might be able to start by dropping your data into an example like this:

https://kitware.github.io/vtk-examples/site/Cxx/VolumeRendering/SmartVolumeMapper/

I think you need to restart slicer in between each setPartitions() attempt. Let me know if this isn’t clear - replying on phone, sorry for short post.

Hi! Thank you for all helps! I have tested to restart after every setPartitions attempts and with eyes on and off. No difference seem to be noticed.

I have a general feeling it’s the driver of radeon rx 6900 xt which is the problem.

The file I have demonstrated is around 11Gb, it can be visualized, although not correctly.

I have tested another file around 7Gb, which cannot be visualized at all using GPU, nothing seemed to happen (CPU works slow but shows 3D correctly). Nvidia cards acted in the same way before 2019 Dec. A driver update after that date solved the problem. Hopefully AMD will eventually update their drivers and everything will work wonder :dizzy_face: I’ll give up for now.

Best regards
Hao Li

@Hao_Li I was thinking to get an RX 6800 XT or 6900 XT for a project using also the VR module.
Might I ask if you are under Windows, or Linux, and if have had also the opportunity to test in VR
And finally you was using Normal or Adaptive quality.

Hi! I ran slicer with 6900XT on windows 10 Pro under Normal quality. I did not have the possibility to test VR. It was very buggy with 6900XT. Probably data I was working with are very large.

I also run slicer with Nvidia 3090, 1080TI and 1070. Even with 3090, Adaptive quality feels slow.

1 Like