-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crop OME Tiff file loose Plane tags #14
Comments
I think this is because the ImgSaver creates a Metadata from the source ImgPlus and uses it to translate - effectively losing any format-specific Metadata (such as OME-XML). What should happen is that we update ImgSaver to use SCIFIOImgPlus instead, then use translate(Metadata, ImageMetadata) where the Metadata comes from SCIFIOImgPlus.getMetadata() (to include any format-specific metadata) and the ImageMetadata comes from the current SCIFIOImgPlus, as before (to account for updates such as cropping). |
Progress towards scifio/scifio-ome-xml#14 However, although this lays the framework for the problem to be fixed, it currently relies on modification of ImgPluses to use the copy() method, which it seems like common operations (such as crop and adjusting dimensionality) do not. So a more universal method of storing/preserving this metadata might be necessary.
So, I made some changes to SCIFIO that should preserve metadata when writing, but there is a larger problem that I think most operations create new I can't think of a good way to solve this right now, unfortunately. So this ticket may have to remain open for a bit. |
Ok I get it Mark. I have a question : why are you using ImgPlus while SCIFIO is becoming standard for I/O in IJ2 ? Can't you use ScifioImgPlus instead ? Maybe you want to separate IJ2 to SCIFIO at some point. |
@hadim I am actually updating SCIFIO code to use However, there are a number of operations that were written before It definitely has the capacity to work via the So on our end we could refactor IJ2 commands that use So maybe it was a mistake to just attach @ctrueden or @dscho do you have any suggestions on how to avoid losing |
Ok I understand the issue here. I let you decide the best way to handle that. However preserving metadata across image manipulations (even if it cannot be done for every situations I guess) seems to be pretty important to me. I am not talking about supporting metadata propagations on IJ1 plugins. IJ2 plugins support should be sufficient in my opinion. Last thing you may want to think about : how far do you want to be able to preserve metadata ? First example with Plane tags is pretty easy to handle. But what for example if the user decide to delete on frame over two ? Could you easly handle this case ? Your choice guys. Thank you again to take care about all these things and good luck ! |
@hinerm Not sure if this is related, but I notice an oddity with how |
@hinerm wrote:
We need to hack ImgLib2 itself. The This addresses a long-standing ticket in the ImageJ Trac, and will likely make it easier for SCIFIO to cache information in an @hinerm: To be clear: upon reflection, I don't like it that you had to create Not to mention the fact that if the API promises an |
Plane tags are not mandatory in OME XML but they can contain very sensitive informations such as time, XYZ position and exposure time.
When an OME Tiff file is cropped, saved and then re open. Plane tags contained in the original file are missing.
Is that a bug or something you don't translate intentionally ?
I report here missing Plane tags because I use them but the same comment could be done for other optionals OME XML metadata.
PS: when I say Save and Open, I only use Legacy mode & Bio-Formats plugin or Modern mode.
The text was updated successfully, but these errors were encountered: