Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GrayscaleModelMaker geometry incorrect in 5.6.1 but works in preview #7668

Closed
pieper opened this issue Apr 1, 2024 · 3 comments · Fixed by #7643
Closed

GrayscaleModelMaker geometry incorrect in 5.6.1 but works in preview #7668

pieper opened this issue Apr 1, 2024 · 3 comments · Fixed by #7643
Labels
Type: Bug Something isn't working correctly

Comments

@pieper
Copy link
Member

pieper commented Apr 1, 2024

Summary

There's a large inaccuracy in the location of the model created by the GrayscaleModelMaker module in several recent releases. The volume in question is somewhat far from the origin and is slightly rotated.

In a recent preview it looks like this, as it should:
image

In 5.6.1, either the binary downloaded or a local build it looks like this:
image

Steps to reproduce

  • Download this zip and extract nrrd file:

ProblemVolume.nrrd.zip

  • Load as normal scalar volume

  • Use Grayscale Model Maker with default settings

  • Enable slice display in Models module

Note: the segmentations infrastructure does not appear to have this regression, so I have suggested that the users who reported this issue migrate to that method since this module is very old. Still, it would be good to know what is at the heart of this.

Environment

  • Slicer versions: I tested some older versions of slicer.

    • 4.0.1 (2012-01-06) it works correctly
    • 4.6.0 (2016-10-13) it works correctly
    • 4.11.20200930 it fails
    • 5.0.2 (2022-05-06) if fails
    • 5.6.1 (2023-12-12) if fails
    • 5.7.0 (2024-03-25) it works correctly
      so something appears to have happened in between that has since been corrected in the current preview version.
  • Operating system: My tests were on Mac, but the issue was reported to me on Windows

@jcfr
Copy link
Member

jcfr commented Apr 2, 2024

Looking at the changes associated with SuperBuild/External_VTK.cmake, update to vtkWindowedSincPolyDataFilter may have fixed the problem:

image

cc: @lassoan @pieper

@jcfr jcfr added the Type: Bug Something isn't working correctly label Apr 2, 2024
@jcfr
Copy link
Member

jcfr commented Apr 2, 2024

Applying this patch updating vtkWindowedSincPolyDataFilter to use the Hamming function allow to revert back to the "failing" case:

diff --git a/Modules/CLI/GrayscaleModelMaker/GrayscaleModelMaker.cxx b/Modules/CLI/GrayscaleModelMaker/GrayscaleModelMaker.cxx
index 7db9cec856..89bfe29ff2 100644
--- a/Modules/CLI/GrayscaleModelMaker/GrayscaleModelMaker.cxx
+++ b/Modules/CLI/GrayscaleModelMaker/GrayscaleModelMaker.cxx
@@ -185,6 +185,7 @@ int main(int argc, char* argv[])
       std::cerr << "Warning: Smoothing iterations of 1 not allowed for Sinc filter, using 2" << endl;
       Smooth = 2;
     }
+    smootherSinc->SetWindowFunctionToHamming();
     smootherSinc->SetInputData(mesh_LPS);
     smootherSinc->SetNumberOfIterations(Smooth);
     smootherSinc->FeatureEdgeSmoothingOff();

@jcfr jcfr linked a pull request Apr 2, 2024 that will close this issue
@jcfr
Copy link
Member

jcfr commented Apr 2, 2024

Closing this issue as we identified which VTK update effectively fixed the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working correctly
Development

Successfully merging a pull request may close this issue.

2 participants