You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an issue reading an ND2 file as a CellImg. I have plugins that take an ImagePlus as input and re-opens it as a CellImg. This is done, instead of just converting it to an Img becasue the underlyhing ImagePlus can be very large, and is often a virtual image. Up until very recently this process was working fine. However now it fails with ND2 images, but not with .tifs. Below is the error that occurs and a Command that can be used to repeat the problem. An example image is in dropbox here
at net.imglib2.cache.util.CacheAsUncheckedCacheAdapter.get(CacheAsUncheckedCacheAdapter.java:32)
at net.imglib2.img.cell.LazyCellImg$LazyCells.get(LazyCellImg.java:104)
at net.imglib2.img.list.AbstractLongListImg$LongListCursor.get(AbstractLongListImg.java:98)
at net.imglib2.img.cell.CellCursor.getCell(CellCursor.java:94)
at net.imglib2.img.cell.CellCursor.moveToNextCell(CellCursor.java:182)
at net.imglib2.img.cell.CellCursor.reset(CellCursor.java:152)
at net.imglib2.img.cell.CellCursor.(CellCursor.java:88)
at net.imglib2.img.cell.AbstractCellImg.cursor(AbstractCellImg.java:92)
at net.imglib2.img.cell.AbstractCellImg.cursor(AbstractCellImg.java:51)
at net.imglib2.img.AbstractImg.firstElement(AbstractImg.java:81)
at net.imagej.ImgPlus.firstElement(ImgPlus.java:276)
at net.imagej.DefaultDataset.getType(DefaultDataset.java:220)
at net.imagej.DefaultDataset.isSigned(DefaultDataset.java:225)
at net.imagej.DefaultDataset.mergedColorCompatible(DefaultDataset.java:704)
at net.imagej.DefaultDataset.(DefaultDataset.java:101)
at net.imagej.DefaultDatasetService.create(DefaultDatasetService.java:200)
at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:128)
at com.doublehelixoptics.testcommands.TestImgOpenerCommandSimple.run(TestImgOpenerCommandSimple.java:51)
at org.scijava.command.CommandModule.run(CommandModule.java:199)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
import java.io.File;
import java.io.IOException;
import org.scijava.command.Command;
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;
import ij.ImagePlus;
import io.scif.config.SCIFIOConfig;
import io.scif.config.SCIFIOConfig.ImgMode;
import io.scif.services.DatasetIOService;
import net.imagej.Dataset;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.RealType;
@Plugin(type = Command.class, headless = true, menuPath = "Plugins>Test Cell Image Opener Simple")
public class TestImgOpenerCommandSimple<T extends RealType<T> & NativeType<T>> implements Command {
@Parameter
DatasetIOService io;
@Parameter
ImagePlus image;
public void run() {
// create the SCIFIOConfig. This gives us configuration control over
// how the ImgOpener will open its datasets.
final SCIFIOConfig config = new SCIFIOConfig();
// Use CellImg mode to load the image. CellImgs dynamically load
// image regions
// and are useful when an image won't fit in memory
config.imgOpenerSetImgModes(ImgMode.CELL);
File imageFile = new File(image.getOriginalFileInfo().directory + image.getOriginalFileInfo().fileName);
Dataset data = null;
try {
// open with DatasetIOService
data = io.open(imageFile.getAbsolutePath(), config);
for (int d = 0; d < data.numDimensions(); d++) {
System.out.println(data.axis(d).type());
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
The text was updated successfully, but these errors were encountered:
BobHanson
added a commit
to BobHanson/scifio-SwingJS
that referenced
this issue
Dec 31, 2019
Hi all
I'm having an issue reading an ND2 file as a
CellImg
. I have plugins that take anImagePlus
as input and re-opens it as aCellImg
. This is done, instead of just converting it to anImg
becasue the underlyhingImagePlus
can be very large, and is often a virtual image. Up until very recently this process was working fine. However now it fails with ND2 images, but not with .tifs. Below is the error that occurs and aCommand
that can be used to repeat the problem. An example image is in dropbox hereat net.imglib2.cache.util.CacheAsUncheckedCacheAdapter.get(CacheAsUncheckedCacheAdapter.java:32)
at net.imglib2.img.cell.LazyCellImg$LazyCells.get(LazyCellImg.java:104)
at net.imglib2.img.list.AbstractLongListImg$LongListCursor.get(AbstractLongListImg.java:98)
at net.imglib2.img.cell.CellCursor.getCell(CellCursor.java:94)
at net.imglib2.img.cell.CellCursor.moveToNextCell(CellCursor.java:182)
at net.imglib2.img.cell.CellCursor.reset(CellCursor.java:152)
at net.imglib2.img.cell.CellCursor.(CellCursor.java:88)
at net.imglib2.img.cell.AbstractCellImg.cursor(AbstractCellImg.java:92)
at net.imglib2.img.cell.AbstractCellImg.cursor(AbstractCellImg.java:51)
at net.imglib2.img.AbstractImg.firstElement(AbstractImg.java:81)
at net.imagej.ImgPlus.firstElement(ImgPlus.java:276)
at net.imagej.DefaultDataset.getType(DefaultDataset.java:220)
at net.imagej.DefaultDataset.isSigned(DefaultDataset.java:225)
at net.imagej.DefaultDataset.mergedColorCompatible(DefaultDataset.java:704)
at net.imagej.DefaultDataset.(DefaultDataset.java:101)
at net.imagej.DefaultDatasetService.create(DefaultDatasetService.java:200)
at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:128)
at com.doublehelixoptics.testcommands.TestImgOpenerCommandSimple.run(TestImgOpenerCommandSimple.java:51)
at org.scijava.command.CommandModule.run(CommandModule.java:199)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
The text was updated successfully, but these errors were encountered: