feat: volume rendering show value in layer bar#1007
Draft
seankmartin wants to merge 3 commits into
Draft
Conversation
this avoids recreating the memory each draw
previously with volume rendering on, you would sometimes see the value in the layer bar because the picking handling in the UserLayer would call getValueAt on all render layers, and the image render layer would pick up the value from the volume rendering max projection depth. Since this is the case, it is better for us to be consistent and always show this value. This requires explicitly mapping 0n picking values to null. And then adding a getValueAt to volume render layers. This getValueAt mimics the function in the sliceViewVolumeRenderLayer. This causes one bug, which is that null is reported outside the bounds very often. This will be addressed later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is currently a bit of an odd interaction with the value reported for image layers with volume rendering activated.
Because we can't really provide a single value for what is under the cursor for volume rendering ON (we can in max and min, since we have a single intensity), we instead always showed 0 as the value. However, because of how
captureSelectionStateworks in the user layer, the following is happening fairly often in mixed scenes:captureSelectionStateis called on the imageUserLayer.pickedRenderLayerincaptureSelectionStateis therefore not theVolumeRenderingRenderLayer, and so it falls through the iterating through allrenderLayersin theUserLayerto check if any return a valid result fromrenderLayer.getValueAt.VolumeRenderingRenderLayerhas nogetValueAtfunction, but theImageRenderLayerdoes. The imageUserLayerhas both aVolumeRenderingRenderLayerand anImageRenderLayersince this is a multi-panel setup. TheImageRenderLayerperform a lookup on the chunk value even though theVolumeRenderingRenderLayerhas nogetValueAtfunction.The changes here aim to make the above system consistent. You always see a value in the layer value indicator by reprojecting the value from the depth buffer at the cursor back to world space. In the case of only having volume rendering, that means the value seen is the min/max intensity along a ray under the cursor. This is done by essentially forcing Step 3 in the above description to always happen, if the
pickedRenderLayeris theVolumeRenderingRenderLayerthen we usetransformPickedValueon theVolumeRenderingRenderLayerto ignore the picked state value (would be 0n) and return null instead to force iterating through all therenderLayers.Screencast.from.2026-05-22.12-31-08.webm
I have this in draft at the moment because there is a bug with excluding the out of bounds information to avoid seeing "null" out of bounds (edit, I'm realising now the image render layer has no such protection, which means likely its not needed in the volume render layer either and the issue is from something else). The filtering works after a refresh but not before.
UserLayer.captureSelectionStatefor reference: