Visualizing 3D polydata of the model in 2D slice view

Hi all.
The idea is to display the 3d model in the same way as its intersection with the slice plane, that is each 2D slice view display the 3d model from its own “angle of view”.
I’m trying to add the polydata of the vtkMRMLModelNode to the visualizing pipeline of the vtkMRMLModelSliceDisplayableManager class simply by adding the 3d actor and vtkPolyDataMapper.
The only TransformFilter I’m using is the ModelWarper - the one that is used for transforming the 2d intersection polydata. The rendered polydata seems to be inproperly positioned and oriented as can be seen on the screenshot below.

Could anyone please advise me which transform should I use to achieve the initial goal? Thank you in advance.


3D views are supposed to be used for displaying 3D content. If you want to show mixed 2D and 3D (e.g., image slice and 3D content) then you also need to use 3D views. What is your end goal? Augmented reality display?

Hi Andras!

No, the goal is to display the full 3d model behind its intersection with the slice plane. The screenshot in my initial post shows that 3D content can be shown within 2D view. The only problem that I’m currently facing is the absence of the transformation matrix which should be applied to the polydata.
My guess is that it should be in form of the RASToXY, but it would give me the display coordinates, which is unsuitable in case of 3D mapper/actor.

You are not supposed to add 3D actors to slice views. If you want to work with 3D actors then you need to use 3D views.

You can display clipped models in the 3D view (see clipping section in Models module). You can also show slice view in 3D views (click eye icon of the slice view to enable this). If these are not enough then tell a bit more about what exactly you would like to show (an example rendering or photoshopped image of what you would like to see would help a lot).

Yes, please! I’m quite curious now.

Hi Csaba!

The initial goal is to have a dental implants viewer based on Slicer (as it already has the radiological background for working in several view projections). Below is the snapshot of the UI of the Blue Sky Plan dental software which has the exact functionality that I’m trying to achieve for displaying both the 3d model of the implant and its intersection with the current slice (overlayed) within the 2D slice view:


To achieve the result shown on the snapshot from my initial post, I had to modify the vtkMRMLSliceModelDisplayableManager class, precisely I’ve increased the number of rendering layers in the renderwindow and added additional 2 renderers for 3D model and 2D intersections accordingly.
As I already wrote, if I could apply the proper transformation matrix to 3D polydata, the problem would be solved then.

1 Like

You already achieve this visualization in 3D views. You can disable camera rotation by mouse (see Slicer script repository for details). You can also set up slice view to be parallel to the camera image plane (in Reformat module).

In 2D views you can see intersection or (optionally distance-encoded) projection of models.

I’m wondering if there is no suitable transformation for the 3d model to be shown properly scaled, considering the fact that this model is already shown as 3D polydata in 2D slice view.

Could you please clarify on that?

I agree with Andras, you can achieve the same thing you want by actually not modifying any classes.

However I think in your case it’s just a matter of removing pipeline->Cutter and everything after this filter from the pipeline to prevent creating the slice intersection and showing the model as is. The slice intersection is already in the proper position so you just need to use what is being done there.

There certainly is. However, even if the actor appears correctly, by placing 3D content into slice views you violate basic assumption of Slicer core and extension developers. It is difficult to assess what problems it may cause, but probably markup fiducials and other content would be occluded.