scenerygraphics / sciview

sciview is a tool for visualization and interaction with ND image and mesh data
BSD 2-Clause "Simplified" License
68 stars 17 forks source link

Fix isosurfaces with latest releases #418

Closed kephale closed 3 years ago

kephale commented 3 years ago

As reported here: https://forum.image.sc/t/sciview-how-to-scale-stl-model-dimensions/58973/6

Isosurface commands used some kludges that compensated for the bug that came from scenery's old volume flipping issue. These need to be undone. I would also suggest making isosurfaces child nodes of the Volume which requires a couple of extra changes.

kephale commented 3 years ago

There also seem to have been some changes in the default CullingMode. You can see this if you test VolumeRenderDemo with the isosurface option. It works if the isosurface has a CullingMode of None.

imagesc-bot commented 3 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/sciview-how-to-scale-stl-model-dimensions/58973/8

kephale commented 3 years ago

The Isosurface command should actually use a parameter like:

    @Parameter(persist = false)
    private Volume volume;

All Volumes are created by SciView.addVolume methods, but this leads to 2 data representations:

Both of these are tracked in the Volume's metadata (see the respective addVolume calls), but things get a little nasty with the ImgLib2 generics. It might be worth taking a step back and thinking about how to associate Volume and a generic image data source in a way that doesn't degrade into unpleasantness with generics.

kephale commented 3 years ago

This is being worked on here https://github.com/scenerygraphics/sciview/tree/fix-isosurface

kephale commented 3 years ago

The fix-isosurface branch fixed this in local IDE-based builds, but it doesn't work when used in Fiji (merged to the scivew update site in https://github.com/scenerygraphics/sciview-update-sites/commit/a1ed05e6a5cb49c91a1b3bb668ba43a0f63e1fdd).

skalarproduktraum commented 3 years ago

@kephale CullingMode has not changed at all. What might affect it though is the vertex ordering, which is counterclockwise in scenery. If the Isosurface command uses CW instead of CCW, that'd be the source of the problem.

kephale commented 3 years ago

To be clear, the bug itself is solved, and works when you run sciview in intellij. The problem is with sciview running on the update site.

@frauzufall is checkout out whether there is something funky between the classpaths. That is the only clue I can come up with at the moment.

kephale commented 3 years ago

@frauzufall found the issue with this, and it is closed starting with this version of the update site: https://github.com/scenerygraphics/sciview-update-sites/commit/6bd9b2b7ba4d02e958e30eb98e514d74f348c484