NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #1704 (closed defect: wontfix)

Opened 2013-03-19T14:39:57-05:00

Last modified 2014-05-16T21:02:18-05:00

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

Description

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 2013-03-19T15:11:09-05:00 by bdezonia

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

comment:2 Changed 2013-03-19T16:09:41-05:00 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 2013-04-03T13:51:54-05:00 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 2013-05-28T10:38:25-05:00 by bdezonia

  • Blocking 9 added; 1563 removed

comment:5 Changed 2013-06-05T15:14:48-05:00 by bdezonia

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

comment:6 Changed 2013-06-07T15:34:00-05:00 by curtis

  • Blocking 1920 added

comment:7 Changed 2013-06-07T15:37:54-05:00 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 2014-05-07T04:25:11-05:00 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 2014-05-16T21:02:18-05:00 by curtis