I am creating a tiff image using python package tifffile. defining metadata as below, and using it to create the tiff file as below. But when I open the generated file using QuPath, and click on the ‘0.01x’ (magnification) button, it asks for ‘downsampling factor’, not ‘magnification’. What change shall I make in my file generation code, to get the magnification prompt? In internet, I read that this might occur if the image is not calibrated, but I am giving pixel sizes in the metadata. Please help.

panorama_metadata = {
“MetaMorph”: “no”,
“BitsPerSample”: “8”,
“Orientation”: “1st row - top; 1st column - left”,
“TileWidth”: self.tile_width,
“Compression”: self.compression_method,
“PhotometricInterpretation”: “YCbCr”,
“ResolutionUnit”: “micrometer”,
“XResolution” : 1/285,
“YResolution” : 1/285,
“ReferenceBlackWhite”: “0”,
“NumberOfChannels”: “3”,
“SamplesPerPixel”: “3”,
“ImageWidth”: total_pixels_in_cols,
“TileLength”: self.tile_height,
“MetaDataPhotometricInterpretation”: “RGB”,
“SampleFormat”: “unsigned integer”,
“ImageLength”: total_pixels_in_rows,
“PlanarConfiguration”: “Chunky”,
}

with TiffWriter(os.path.join(self.output_path,
self.slide_name + “.ome.tif”),
bigtiff=True) as tif:
                tif.save(data=self.get_numpy_arrays(number_of_columns,
                                                    number_of_rows,
                                                    max_folder_path),
                         shape=panorama_shape,
                         tile=(self.tile_height, self.tile_width),
                         dtype=numpy.uint8, photometric='rgb',
                         metadata=metadata)
0

There are 0 best solutions below