imagej / imagej/imagej-plugins-commands

Offer to convert types if needed when saving

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Some image formats can only save to certain image types. When attempting to save an image which is not one of those types, an exception similar to the following occurs:

```
[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)
```

We should at minimum make this message nicer (display a dialog instead of an exception dump). But really, it would be nice to offer to convert to a supported output format rather than just failing. We might need to add some API to SCIFIO for this.

Migrated from [Fiji bug #315](http://fiji.sc/cgi-bin/bugzilla/show_bug.cgi?id=315) and [OME ticket #5323](http://trac.openmicroscopy.org.uk/ome/ticket/5323). See also [ImageJ Trac ticket #1704](http://trac.imagej.net/ticket/1704).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in imagej.core.commands.io.SaveAsImage.run and follow the ImgSaver.saveImg, initializeWriter, and populateMeta calls shown in the stack trace. First inspect how the save command handles ImgIOException, then determine how a supported conversion could be offered through the SCIFIO API. Done means failed saves show a dialog and users can choose conversion when the output type is unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.