Closed ctrueden closed 6 years ago
@maarzt Please make this a priority. This needs to work
Ok, this is a priority. But how to duplicate a VirtualStack that wraps arround an imglib2 image?
To me the second option seems to be the way to go. Because the result of the duplicate would be a fully functional IJ1 ImageStack.
Create an ImageStack and copy all pixels.
This one.
The problem is that some IJ1 functionality does not work with VirtualStacks. Usually if you want to use these things, you duplicate the image to get a non-virtual one. So copy everything is exactly what we want. It will not work for really big stuff etc, but that's not the point in this case...
Ok, it's done, @tpietzsch should be ready for merge and release
I released imglib2-ij-2.0.0-beta-42
, and uploaded to the Java-8 Fiji update site
Wow, thanks for the fast response, guys! 🥇
@maarzt @tpietzsch There is a similar issue/question for the ImgFactory
of a SCIFIOImgPlus
. I'd like to discuss+decide in person in Dresden what the best thing to do would be for the ImgFactory
of the SCIFIOImgPlus
.
For reference, here is an example stack trace snippet exhibiting the limitation:
Call setReader(Reader) before invoking create()
at io.scif.img.cell.SCIFIOCellImgFactory.create(SCIFIOCellImgFactory.java:366)
at io.scif.img.cell.SCIFIOCellImgFactory.create(SCIFIOCellImgFactory.java:92)
at net.imagej.DefaultDataset$1.makeImgPlus(DefaultDataset.java:744)
at net.imagej.DefaultDataset$1.create(DefaultDataset.java:731)
at net.imagej.DefaultDataset$1.create(DefaultDataset.java:720)
at net.imglib2.img.ImgFactory.create(ImgFactory.java:168)
at net.imagej.ops.create.img.Imgs.create(Imgs.java:64)
See also https://github.com/imagej/imagej-omero/issues/92#issue-328204329 for where this can happen in practice.
Attempting to invoke the
duplicate()
method of anet.imglib2.img.display.imagej
virtual stack data structure does not work. This prevents some use cases e.g. Morphological Segmentation:To reproduce the above exception, enable the IJBP-plugins update site, open a big cell image, then try running the "Morphological Segmentation" plugin on it.