Ticket #1724 (new defect)

Opened 6 years ago

Last modified 6 years ago

File Revert has limitations

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-unscheduled
Component: Plugins Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1633

Description

File Revert reverts an image to it's original state if and only if it has a file (or maybe URL) as a source. An image created by a plugin cannot revert. Examples of these include opening sample images.

I think revert should have different behavior. At least when an image does not have a file as a source we should do an UNDO ALL call. Or rerun the original plugin(?). UNDO ALL needs to wait on undo to be finished and of course it wouldn't necessarily work if the undo history was not big enough to hold all the necessary changes. Some thought is required here.

Right now if you try to revert a sample image you get an exception thrown. At the very least we should avoid the exception.

java.io.FileNotFoundException: (No such file or directory)

at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:216)
at ome.scifio.io.NIOFileHandle.<init>(NIOFileHandle.java:130)
at ome.scifio.io.NIOFileHandle.<init>(NIOFileHandle.java:141)
at ome.scifio.io.NIOFileHandle.<init>(NIOFileHandle.java:150)
at ome.scifio.io.Location.getHandle(Location.java:309)
at ome.scifio.io.Location.getHandle(Location.java:280)
at ome.scifio.io.Location.getHandle(Location.java:270)
at ome.scifio.io.Location.checkValidId(Location.java:333)
at loci.common.Location.checkValidId(Location.java:243)
at loci.formats.ImageReader.getReader(ImageReader.java:177)
at loci.formats.ImageReader.setId(ImageReader.java:757)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:563)
at loci.formats.ChannelFiller.setId(ChannelFiller.java:263)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:563)
at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:274)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:563)
at net.imglib2.io.ImgOpener.createReader(ImgOpener.java:497)
at net.imglib2.io.ImgOpener.initializeReader(ImgOpener.java:555)
at net.imglib2.io.ImgOpener.openImg(ImgOpener.java:319)
at net.imglib2.io.ImgOpener.openImg(ImgOpener.java:293)
at net.imglib2.io.ImgOpener.openImg(ImgOpener.java:252)
at imagej.io.DefaultIOService.loadDataset(DefaultIOService.java:117)
at imagej.io.DefaultIOService.revertDataset(DefaultIOService.java:129)
at imagej.core.commands.io.RevertImage.run(RevertImage.java:88)
at imagej.command.CommandModule.run(CommandModule.java:163)
at imagej.module.ModuleRunner.run(ModuleRunner.java:169)
at imagej.module.ModuleRunner.call(ModuleRunner.java:126)
at imagej.module.ModuleRunner.call(ModuleRunner.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)

Change History

comment:1 Changed 6 years ago by bdezonia

  • Blocking 1633 added; 1563 removed
  • Milestone changed from imagej2-b7-ndim-data to imagej2-unscheduled

With commit 2be2b78248ee90292f99acbc11b771c9fdf09159 the exception is now avoided. Pushing the rest of this ticket (the UNDO approach) to a later time.

Note: See TracTickets for help on using tickets.