View Issue Details

IDProjectCategoryView StatusLast Update
0004569Slicer4Core: Segmentationpublic2018-06-11 11:11
Reporterfepegar Assigned Topinter  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version17.04
Product VersionSlicer 4.8.1 
Target VersionFixed in VersionSlicer 4.9.0 
Summary0004569: Normals are flipped when smoothing factor is 0
Description

When I create a closed surface representation of some segmentations with no smoothing factor, normals seem to be flipped. If it's 0.01, the mesh looks fine.

Steps To Reproduce

Load the attached file
Go to Segment Editor
Threshold Effect
Set lower threshold to 35
Show 3D with 0 smoothing factor

Additional Information

The uploaded image is an MR angiography.

Tried on r27221

TagsNo tags attached.

Activities

fepegar

fepegar

2018-06-01 05:57

reporter  

pc.nrrd (1,338,405 bytes)
pinter

pinter

2018-06-01 10:46

developer   ~0015867

Thanks, I'll look into this soon

pinter

pinter

2018-06-07 17:35

developer   ~0015880

I was able to reproduce the issue. To fix the normals in the same version, disabling the "Compute surface normals" flag (interestingly) results in proper normals. You can do this in Segmentations module, by clicking Update on the Closed surface representation.

I'm trying to fix it so that the normals are fine with the flag turned on, as it's supposed to be.

fepegar

fepegar

2018-06-08 09:04

reporter   ~0015882

Thanks. For now I'll stick to performing the smoothing with a very small factor, since it looks better and doesn't modify the model (too much?).

pinter

pinter

2018-06-11 11:07

developer   ~0015883

It turned out that the surface was inside out because the volume you attached is in a left-handed coordinate system. So if you just painted a sphere, and showed surface with no smoothing, it was also black. The solution was to detect this case, and if normals is computed by the marching cubes step (which happens when moothing is set to 0), then the normals are flipped as a post-processing step.

Fixed in https://github.com/Slicer/Slicer/commit/47d1643030d8c6e7cdb2953a8ad5acfee1836803

fepegar

fepegar

2018-06-11 11:11

reporter   ~0015884

Thanks Csaba!

Issue History

Date Modified Username Field Change
2018-06-01 05:57 fepegar New Issue
2018-06-01 05:57 fepegar Status new => assigned
2018-06-01 05:57 fepegar Assigned To => pinter
2018-06-01 05:57 fepegar File Added: pc.nrrd
2018-06-01 10:46 pinter Note Added: 0015867
2018-06-07 17:35 pinter Note Added: 0015880
2018-06-08 09:04 fepegar Note Added: 0015882
2018-06-11 11:07 pinter Status assigned => resolved
2018-06-11 11:07 pinter Resolution open => fixed
2018-06-11 11:07 pinter Fixed in Version => Slicer 4.9.0
2018-06-11 11:07 pinter Note Added: 0015883
2018-06-11 11:11 fepegar Status resolved => closed
2018-06-11 11:11 fepegar Note Added: 0015884