Skip to content
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

OMEPyramidWriter ignores file extension to always write ome.tif #857

Closed
petebankhead opened this issue Dec 14, 2021 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@petebankhead
Copy link
Member

Bug report

Describe the bug
OMEPyramidWriter was created to write OME-TIFF images. However, it is possible to pass it a path with any extension - in which case it may write an ome.tif masquerading as something else.

To Reproduce
Steps to reproduce the behavior:

  1. Open a 'small' image, e.g. CMU-1-Small-Region.svs
  2. Run a script like the one below to try to write a JPEG 2000 image
  3. Use tiff info to confirm that the .jp2 image written is actually a TIFF
import qupath.lib.images.writers.ome.OMEPyramidWriter
    OMEPyramidWriter.writeImage(getCurrentServer(),
    "/path/to/output.jp2",
    OMEPyramidWriter.CompressionType.J2K)

Expected behavior
There are three main options:

  1. Refuse to write the image if it doesn't end with ome.tif
  2. Add ome.tif as a file extension if it is originally anything else
  3. Actually support writing in different file formats, if allowed by Bio-Formats

The third seems more desirable - particularly as Bio-Formats 6.8.0 introduces support for writing DICOM whole slide images, which may be very useful in the future.

Desktop (please complete the following information):

  • OS: All
  • QuPath Version 0.3.0

Additional context
I have explored some small changes that come closer to supporting different file formats, although there can be some gotchas - for example, if other formats don't support multiple resolutions or tiling, or require the reader to be initialised in a specific way.

It is likely that QuPath's OMEPyramidWriter.CompressionType may become inadequate; certainly it isn't desirable to always require a compression type for formats where it isn't customisable.

@petebankhead petebankhead added this to the v0.3.1 milestone Dec 14, 2021
@petebankhead petebankhead self-assigned this Dec 14, 2021
petebankhead added a commit to petebankhead/qupath that referenced this issue Dec 14, 2021
Fixes for
* qupath#857
* qupath#858
This introduces the ability to write some other file formats using OMEPyramidWriter.
It also adds the ability to specify --big-tif with the convert-ome command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant