Basically, I thought that half of the volume would be transparent from the ImageData to UniformGrid filter but it’s fully viewable in the render view (take a slice of the output with a Y normal to see the blanked part of the uniform grid). I thought I heard about using separate fields for the color transfer function and opacity transfer function in ParaView but I couldn’t find that option. Does this functionality exist or was it just at the discussion stage?
I can probably get the effect I want with just playing around with the transfer function and using a Calculator filter to combine the blanking field and the pseudo-colored field (they’re both point data).
It is possible to do it, but it is not at all easy. Making it much simpler in the UI is slated for this year.
As for blanking, it doesn’t look to me like blanking is respected by any of the volume renderers for uniform grid data. I’ll check with the volume rendering experts to confirm.
I confirmed that the volume renderer ignores blanking/ghost cell flags, but it wouldn’t be too hard to add support for it. We may be able to do this when adding support for rectilinear grid volume rendering this year.
That’s curious. Ghost flags is indeed what’s relied on by volume rendering of unstructured grid datasets after applying resample to Image or Adaptive Resample to Image filters. Maybe the blanking for uniform grids is independent of the ghostcell logic and just needs to be consolidated.
In general, the volume mappers do no support ghost information. Adding support for ghost cells to the GPU volume mapper should not be a difficult task, though.
Looking at this a bit more, the vtkGhostType cell data array that comes out of ResampleToImage is incorrect. See the attached state file for PV 5.8. resamplecellghostbug.pvsm (681.5 KB)
Here, I create a source and then clip at an odd angle so that the Resample to Image filter should want to label some ghost stuff. Then I copy the cell blanking array using the Calculator filter and remove the blanking arrays using the Pass Arrays filter to make sure that I can see the actual cell blanking array produced by the Resample to Image filter. Finally, to make sure I’m not seeing surface effects, I use the VOI filter to remove a couple of outer layer cells.
Basically, ResampleToImage is using the vtkGhostType point data array values as the same values for the cell data array. So the next question is, what’s the correct way to compute cell blanking for this filter? At this point I can potentially see two ways:
A cell is blanked if any of its points are blanked.
A cell is blanked if all of its points are blanked.
In my opinion this should be a filter option for the user to decide with #2 as the default.
I’m starting to think that there’s a bug in the Resample to Image filter for the cells that are produced from the output of the Clip filter. I tried to look at them with the 'Validate Cells` filter but that also seems a bit buggy for hex cells (see https://gitlab.kitware.com/vtk/vtk/-/issues/17841).
Any way, looking at the vtkValidPointMask array output from Resample to Image filter for hexes it looks like:
I think the vtkGhostType information that’s computed is correct, based on getting correct vtkValidPointMask information.
This issue though is still orthogonal to properly blanking vtkImageData ghost information during volume rendering. Maybe the output of the Resample to Image filter really should be a vtkUniformGrid instead.