Ticket #1708 (closed defect: moved)

Opened 7 years ago

Last modified 6 years ago

Tiff writing/reading should support metadata

Reported by: bdezonia Owned by: hinerm
Priority: major Milestone: imagej2-b8-analysis
Component: I/O Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1923

Description (last modified by bdezonia) (diff)

Certain image metadata does not make the roundtrip from save to disk to load from disk with Imglib/Scifio's Tiff support. For instance the X, Y, Z, and T calibrations are set before disk write. However our tiff writing code cannot save Z or T because there are not baseline tiff tags that save that data. So saving and then loading a tiff results in Z & T as NaNs. (Side note: ImgOpener could at least default them to 1.0 rather than NaN).

We need to somehow maintain Z & T and other metadata. IJ1 takes the approach of writing its own variant of Tiff and reading that same variant. We could use that variant but that may be too limiting. We could use ome-tiff but adopting ome-tiff may alienate users who are not associated with microscopy. Or we could define our own variant.

One thing to check is if we can extend IJ1's variant and still have IJ1 read the data. There is the case where IJ1 will handle it and the case where IJ1 run from within Ij2 (and using Javassist if needed) will handle it. We don't necessarily need to support the first case.

In the shortest term using libtiff utils or imagemagiack we should play with header changes of IJ1 tiff files and see how IJ1 handles it.

Change History

comment:1 Changed 7 years ago by bdezonia

  • Description modified (diff)

comment:2 Changed 7 years ago by bdezonia

  • Description modified (diff)

comment:3 Changed 7 years ago by bdezonia

  • Description modified (diff)

Related chat log:


ctrueden, what was that one liner for messing with tiff that you were going to share


tiffcomment -edit myFile.tif

Using Bio-Formats command line tools:  http://openmicroscopy.org/site/support/bio-formats/users/comlinetools/
ImageJ1 reads properties from the image description using java.util.Properties. See:  https://github.com/fiji/ImageJA/blob/master/src/main/java/ij/io/FileOpener.java

decodeDescriptionString method.
So adding additional properties will work.
But ImageJ1 barfs if the string does not start with the string "ImageJ:"
Err, "ImageJ="
Hmm, perhaps the equals sign is not required.
But it definitely must start with "ImageJ". There are two places in the code that check that.
I think we can probably stick with that format. *shrug*

comment:4 Changed 7 years ago by bdezonia

  • Owner changed from bdezonia to hinerm
  • Status changed from new to assigned
  • Blocking 1712 added
  • Milestone changed from imagej2-b10-compatibility to imagej2-unscheduled

Mark I am assigning to you right now but not scheduled in any milestone. We will need to do this sooner rather than later but I'm not sure when. If you do not think this ticket is something for you to handle please assign back. Thanks.

comment:5 Changed 7 years ago by hinerm

This will be resolved when the Tiff reader is converted to SCIFIO components, so it should almost certainly be something that I handle.

The Tiff reader is on the list of readers to be converted for a release by the end of May, but it was intended to be the last to convert because of its complexity.

Seeing as it affects IJ2 though, I can make it an April target.

comment:6 Changed 7 years ago by bdezonia

For more background see #1405

comment:7 Changed 7 years ago by bdezonia

  • Blocking 1923 added

comment:8 Changed 7 years ago by bdezonia

  • Blocking 1712 removed
  • Milestone changed from imagej2-unscheduled to imagej2-b8-analysis

comment:9 Changed 6 years ago by curtis

@hinerm, can you please test loading/saving TIFF files from ImageJ2 using SCIFIO, and see whether calibrations are preserved? If so, this ticket is solved. If not, would be good to debug why not (and probably file a new issue in the proper issue tracker and link to it from here and close this one as "moved" or whatever).

comment:10 Changed 6 years ago by curtis

  • Status changed from assigned to closed
  • Resolution set to moved
Note: See TracTickets for help on using tickets.