hello, i use the itk montage stitching tiles and get a tiff file, but it is not standard tiff format i think, which can not be opened in openslide
is there a way to get a OME-XML metadata to the tiff file of itk montage output, or any other fomat supported by openslide above
the itk montage has a warning message dealing with an unsuported image format, but its hard to figure out the exact format by the ImageIO name
Description: Could not create IO object for writing file F:\projects\ITKMontage\examples\output_micro/montage.ngff
Tried to create one of the following:
You probably failed to set a file suffix, or
set the suffix to an unsupported type.
No file IO in ITK knows about
.ngff file format extension. But ITK can read and write TIFF (probably generic variant) files. Support for ZarrNGFF is a work in progress.
It is possible to add whatever metadata you want to the tiff file of ITK montage output, including OME-XML metadata, but that is not implemented. You are the first person to ask for it, so if you want it you will probably have to implement it yourself.
Could the ITK remote module SCIFIO be helpful here?
We should add OME-TIFF metadata input / output support into ITK TIFF’s ImageIO. Tracking issue.
An OME-TIFF could be generated in Python with tifffile with something like:
import numpy as np
image = itk.imread('montage.mha')
with tifffile.TiffWriter('montage.ome.tif', ometiff=True) as tiff:
options = dict(photometric='minisblack', tile=(128, 128), compression='zlib')
axes = 'YX'
metadata['PhysicalSizeX'] = image.GetSpacing()
metadata['PhysicalSizeY'] = image.GetSpacing()
tiff.write(np.asarray(image), **options, metadata=metadata)
Origin and z-spacing could be set with per-