Ticket #1704 (closed defect: wontfix)

Opened 6 years ago

Last modified 5 years ago

1-bit images (and some other pixel typed images) cannot be saved

Reported by: bdezonia Owned by: curtis
Priority: major Milestone: imagej2-b8-analysis
Component: SCIFIO Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1920


Create new 1-bit Image. Verify it can save. Now create a new 8-bit image filled with white or black. Run a legacy plugin like Show Info. The image type is changed to a 1-bit image (this issue documented in ticket #1703). When you try to save it you get an error:

[ERROR] net.imglib2.io.ImgIOException: Pixel type not supported. Please convert your image to a supported type.

at net.imglib2.io.ImgIOUtils.makeType(ImgIOUtils.java:227)
at net.imglib2.io.ImgSaver.populateMeta(ImgSaver.java:631)
at net.imglib2.io.ImgSaver.initializeWriter(ImgSaver.java:596)
at net.imglib2.io.ImgSaver.saveImg(ImgSaver.java:184)
at imagej.core.commands.io.SaveAsImage.run(SaveAsImage.java:141)
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

I can no longer duplicate the ability to ever save as 1-bit.

comment:2 Changed 6 years ago by bdezonia

  • Owner changed from bdezonia to curtis
  • Status changed from new to reviewing
  • Component changed from I/O to SCIFIO

The issue is that scifio does not support all the data types that Imglib does. ImgIOUtils::makeType() barfs on any exotic types like BitType or LongType. And this will be more of a problem as more Imglib types are hatched. (For instance Albert and Steffi were working on a variable bit depth integral numeric type and Curtis wants to add BigInteger and BigDecimal backed types). Scifio needs to eventually accommodate such changes.

Not sure where this ticket belongs.

comment:3 Changed 6 years ago by bdezonia

  • Summary changed from Sometimes 1-bit images cannot be saved to 1-bit images (and some other pixel typed images) cannot be saved

comment:4 Changed 6 years ago by bdezonia

  • Blocking 9 added; 1563 removed

comment:5 Changed 6 years ago by bdezonia

  • Milestone changed from imagej2-b7-ndim-data to imagej2-b8-analysis

comment:6 Changed 6 years ago by curtis

  • Blocking 1920 added

comment:7 Changed 6 years ago by curtis

  • Blocking 9 removed

(In #9) This ticket is really about improving the infrastructure if I/O for ImageJ2. With SCIFIO, we have now done that. The 2.0.0-beta-7 release is using SCIFIO 0.1.0—File Open and File Save are now extensible—so this ticket is complete.

Remaining tickets about improving the existing I/O mechanism have been migrated to ticket #1920.

comment:8 Changed 5 years ago by curtis

  • Status changed from reviewing to closed
  • Resolution set to wontfix

I think the error message is actually pretty clear about what you need to do if you wish to save. We could improve the presentation of the error, but that would be a separate ticket. For now, let's punt; we can work on improving things in a complaint-driven fashion.

comment:9 Changed 5 years ago by curtis

Note: See TracTickets for help on using tickets.