imagej / imagej-legacy

ImageJ+ImageJ2 compatibility layer
https://imagej.net/libs/imagej-legacy
BSD 2-Clause "Simplified" License
17 stars 25 forks source link

LegacyImageMap: do harmonization on display update #174

Closed stelfrich closed 6 years ago

stelfrich commented 6 years ago

Legacy ImagePluses are—in some circumstances—created by copying (not referencing) the underlying pixels of a Dataset. Hence, a change in a Dataset is not propagated properly to the ImagePlus if no harmonization between the two is happening. This PR adds harmonization logic when a DisplayUpdatedEvent is triggered.

stelfrich commented 6 years ago

@ctrueden I have added logic to create an Overlay with some points to the MCVE: https://github.com/stelfrich/imagej-legacy-harmonization-mcve: it takes some seconds to create the Overlay before the widget for the @Parameter pops up. Changing the slider has worked reasonably fine in my tests.

That MCVE needs this PR.

ctrueden commented 6 years ago

@stelfrich When you have time (no rush!), could you please retest your MCVE with the latest master branch of imagej-legacy? The #182 merge has substantially changed how the legacy logic works, with pixels never being copied anymore under any circumstances. However, that does not mean this change still isn't necessary. Thoughts welcome.

stelfrich commented 6 years ago

Sorry for only looking into this now, @ctrueden.

However, that does not mean this change still isn't necessary. Thoughts welcome.

The harmonization, as proposed by this PR, is still required s.t. an IJ1 Overlay is shown as well as the updated pixel data after changing the noise parameter via the dialog. I am not sure if I can find the time to dig into the details of #182, nor the changes in imglib2-ij by @maarzt.

ctrueden commented 6 years ago

OK, I will merge this. Fingers crossed that it does not tank performance for certain use cases. We might have to revert it if that happens.

stelfrich commented 6 years ago

We might have to revert it if that happens.

Agreed! Thanks 👍