Issues 3D view .vtk model

Dear greatest community of all,

I am having issues displaying models whilst segments are looking just fine in 3D view. I am running slicer on linux on a calculation server, never had this kind of troubles before…
affects both slicer 10 and 11.

You need to explain your issue a little better. It is not clear from the screenshot.

My apologies Murat,

when visualising a model, the light projected on the model seem to be coming only from one direction.
If I am looking from a certain angle, model appears:


but as I am changing angle, the model start loosing illumniation:

And eventually becomes completely black upon a full 90° rotation:

This issue is happenning on both slicer10 and 11. To clarify, we are operating on a Linux-based system. I connect to our calculation server cluster interactively using NoMachine for remote access.

This issue is only on .vtk models, whereas .obj and segmentations are looking fine.

More information. I just uploaded some old .vtk files produced via slicermorph or slicermorph+distance to distance models and they loaded fine. So neither slicer 10 or 11 or my environment settings are to blame I think.

However, tt seems that it is only the most recent .vtk files I created via slicermorph that have been affected. I think those would have been created on the latest build (version 11).
I’m now trying creating a .vtk model on slicermorph slicer 10 to see if that works.

Dear all again, and sorry for multiple posts and troubleshooting in small steps but I found that slicermorph on slicer 10 is working as expected:


Here, the model works well. I saved it, reopenned it and again, it displays fine.

So I think it must have something to do with slicer11/slicermorph.

I have run into this before, but unfortunately I don’t remember the details of what the problem was or what made it go away. I haven’t ever used SlicerMorph, though, so that can’t have been the source of the problem when I ran into it. Try turning off “Shadows visibilty” in the 3D view settings. I think the most likely source of the problem is that there is something wrong with the surface normals on these models in particular. Is it possible that the surface normals for these models are unset, or all in the same direction? I think that would lead to the type of behavior you are seeing (i.e. uniform illumination from a single direction across the entire model, which disappears completely at 90 degrees to the normal vector). You could try Surface Toolbox to recalculate the surface normals and see if that fixes the issue.

As @mikebind said this is probably related to surface normals. Are vtk files generated the same way as the obj? Why do you have two different formats?

Hello, and thank you for your answers.

Shadows visibility was set to off. I tried to set it to “on,” and that crashed Slicer 11 on my server. I restarted it, and it was back to the default “off.”

I started looking into the Surface Toolbox, and using the “Splitting” function in Compute Surface Normals worked. I also tried: 1) auto_orient normals, which had no effect; and 2) flip normals, which had the expected effect: the model lighting effect turned on, until I rotated the model by 90°, and then it went black again.

So, splitting works. I set the feature angle for splitting at 90, and I have a good result (not sure what I’d need to change it to but 90° seemed to give the best result). This model is the result of a model-to-model distance computation, and I can tell the end result is correct, so it is purely a display problem that is only apparent in Slicer 11, not Slicer 10.

An important note also: I only used SlicerMorph GPA to create these models, so I don’t know yet if it is specific to SlicerMorph or to Slicer 11 in general on my setup. What is clear is that if I run a GPA in Slicer 11 and load/create a model via the interactive 3D tab, I get those “black” models: the original model and the warped model, even though my original model, if loaded separately, appears normal.

So, things go awry when I use SlicerMorph on Slicer 11 only. Slicer 10 is okay.

Why I use .vtk and .obj is possibly only because I use different modules to export models and they are set by default to either .obj and .vtk. I should probably have enforced using only .obj only ?

How are you accessing this server and how is Slicer displayed? The most important thing are you running this locally on the server or remote connecting to it via some application? When you are running slicer on a remote machine there are many layers of complexities and libraries in between and it is very hard to chase it. Slicer 5.10 and 5.11 uses different vtk builds so that might be reason.

What module do you use in SlicerMorph to generate these? Most SlicerMorph modules (e.g., GPA or ALPACA) doesn’t build 3D models, it simply modifies their existing geometry by deformations. That should not change or matter for anything. Though if the deformation is extreme, surface normals may flip (but that often a sign that there is something wrong with the deformation, like landmark orders messed up etc)…

Thanks for the suggestions.

The machine I am using is a shared calculation/computing server at CCUB/UBE. I access it through NoMachine, so Slicer is running on the remote server in a fully interactive desktop session. I am not running Slicer locally on my workstation. I understand that this adds extra complexity because the display goes through the remote desktop stack, graphics drivers/OpenGL, Qt/VTK, etc., and that the different VTK builds between Slicer 5.10 and 5.11 could be relevant.

Regarding the .vtk files: they are produced/processed through SlicerMorph, specifically in the GPA workflow. What seems strange is that a model created in slicer10 GPA, displays correctly in Slicer 5.11 if I simply open it as a model. The issue appears only when I select that model as the template in GPA to display the transformation. At that point, it shows the display problem I have been facing from the very start (as soon as I “apply” after selecting the model template and landmarls

So it does not look like the .vtk file is generally incompatible with Slicer 5.11, because it can be opened and visualized normally. The problem seems to be triggered specifically by the GPA template selection/display step, or by how GPA handles the mesh after it is chosen as a template. and again, it could be due to different vtk handlers in slicer11 as again, no problem whatso ever in 10.
Hope this makes sense

VTK should be compatible, since it is the format used by the VTK library slicer uses. I think you need to do a simpler test. Create a VTK an OBJ file from a simple segmentation of a sample data using 5.10 and 5.11 and if you can replicate the problem.

Dear Murat,

thanks again for your suggestions. Using a simple segmentation, I exported that segmentation as a model and saved it in both VTK and OBJ format from Slicer 5.10 and 5.11 and loaded them in both versions (5.10 generated model in 5.10 and 5.11 and reciprocally). Everything loaded and displayed correctly, and I could not reproduce the issue. It’s really when the GPA clones the model chosen to display deformation that things are not going well and exclusively in slicer 11.
Many thanks

s

If you can share the whole gpa output as well as the offending (and working) vtk/obj files, I can try to take a look, otherwise I can’t replicate this on my end.

Dear Murat, thank you and the community for following this up.

I have a vague memory that things were originally working in slicer11 GPA since I tested your new GPA module where we can Drive 3D model from the PCA scatter plot (very usefull indeed). If this is the case, the problem is more that something is broken in our installation..I deleted slicermorph and reinstall it fresh. Unfortunately, I still have the same problem but another weird thing happenned: ALPACA suddenly appeared in Slicer11, which was not the case when I first tried sclier11 and installed slicermorph the first time round. This was a couple of weeks ago.

So I am still stuck but I don’t want to waste your time either. i could revert to slicer 10 but I like the feature in the newest build with slicermorph GPA.
Here are the files you requested. FileSender
There are two GPA folders but I had to rename them to indicate which one was done via Slicer10 and which in Slicer 11 so one has a suffix 11 and the other 10. It may have to be deleted I guess.
thanks again for your help

s

I replicated the problem on my mac, and pushed a change that should fix it for you.

Try with tomorrows preview build, or if you can clone the slicermorph and checkout the geomorphTab branch and try immediately.

thanks for reporting.

Me happy :slight_smile:
Many thanks Murat, thanks for the fix !