Open imagejan opened 4 years ago
@imagejan Thanks for summarizing these. We can (and should) change the converter behavior not to touch the LegacyImageMap
. The second point—changing when we synchronize—would require careful consideration and testing.
An important point to test is if conversion/synchronization also works correctly on a higher level that allows interacting with how the current image is displayed (current slice, color map, display settings, etc.):
ImagePlus
<=> ImageDisplay
ImagePlus
<=> DatasetView
See also this discussion on the forum: Analyze the current slice of an ImgPlus in ImageJ2
This issue has been mentioned on Image.sc Forum. There might be relevant details there:
https://forum.image.sc/t/analyze-the-current-slice-of-an-imgplus-in-imagej2/38238/3
This issue has been mentioned on Image.sc Forum. There might be relevant details there:
https://forum.image.sc/t/get-active-image-index-in-an-imagej2-plugin-called-in-fiji/39764/3
I think the comment in https://github.com/imagej/pyimagej/issues/155#issuecomment-989048033 by @ctrueden is relevant here, also without the Python-related parts:
Dataset
/Img
/RandomAccessibleInterval
(e.g. reading a file with SCIFIO, backed by a DiskCachedCellImg
)ImagePlus
ImagePlus
which might change pixels in placeCommand
taking the original ImageJ2/ImgLib2 object as an input, expecting that the changes to the ImagePlus
are synced.The question is when (and at which performance cost) synchronization should be performed. Maybe a boolean option flag to distinguish between an "eager" and a "lazy" mode would make sense here, similar to auto_sync
that @elevans suggests for pyimagej
?
I am posting this here for reference, in case someone will have time to focus on this issue for one week during a future hackathon 😄
Is somebody working on this image or should I maybe do it? @imagejan @ctrueden @hinerm
I'm not sure if @hinerm or @elevans have this on their radar currently, but I guess that you'd be most welcome to work on it, @maarzt! 🙏
@maarzt @imagejan This issue is on our radar and in the queue. We're working on finishing up the PyImageJ publication, getting the PyImageJ documentation/examples in order and releasing a new version of PyImageJ (1.1.0
). The way things are currently planned we will address this issue in the following release (not 1.1.0
as there is not enough time).
There are currently multiple open issues related to IJ1 <-> IJ2 image conversion:
#@ImgPlus img
Loads VirtualStack into RAMImageStack.getProcessor
upon second runUnsupportedOperationException
ColorTableHarmonizer
As mentioned by @ctrueden in https://github.com/imagej/imagej-legacy/issues/186 and https://github.com/imagej/imagej-legacy/issues/229#issuecomment-561296997, we should possibly separate conversion and (lazy) synchronization better and create thorough tests for all (reported and anticipated) use cases.
@ctrueden do you think it would be feasible to change behavior such that:
ImagePlus
<=>Dataset
,Img
,ImageDisplay
etc. does not change theLegacyImageMap
LegacyImageMap
viaLegacyService
) happens only when new UI events happen (i.e.UIService#show()
called, orImagePlus
object created/shown)?