glencoesoftware / bioformats2raw

Bio-Formats image file format to raw format converter
GNU General Public License v2.0
77 stars 35 forks source link

Channel selection? #200

Closed blowekamp closed 1 year ago

blowekamp commented 1 year ago

The input to bioformats2raw is a large ( >500MB) PNG file. It is stored as a 4-channel RBGA image. The alpha channel is empty and contains all zeros, and take extra time and space to convert.

Is there a way to remove a channel during conversion?

melissalinkert commented 1 year ago

At the moment, no, bioformats2raw doesn't allow removing channels or more generally converting a subset of planes in the same Bio-Format series/OME Image.

Pre-processing the PNG to remove the alpha channel (using ImageMagick's convert or similar) is one option. If you're ultimately trying to get an OME-TIFF file, bfconvert with the -split and -range options (https://bio-formats.readthedocs.io/en/stable/users/comlinetools/conversion.html#cmdoption-bfconvert-range) might be worth a try, though it may not be faster than bioformats2raw/raw2ometiff.

blowekamp commented 1 year ago

Those options in bfconvert is what I was looking to use. Are they planned on the road map for this tool?

We are converting for visualization in Neuroglancer, among other usages so zarr this the target format. We will likely just modify the zarr arrays place with python.

Thank you.

melissalinkert commented 1 year ago

We're unlikely to implement options similar to -split and -range here anytime soon. Modifying the arrays in-place after conversion is a reasonable strategy.

Closing this issue to reflect the fact that it's not a planned feature (can re-open if we decide otherwise later on).