Open
Description
Hi,
I am currently working with a large OME-TIFF file (2_CD8.ome.tiff) that is quite high in resolution (9.59 GiB, Shape: (110319, 53873, 3)). For my downstream deep learning tasks, I need to downsample this image to a more manageable resolution.
I am using the following PyVips code to downsample:
import pyvips
def downsample_ome_tiff(input_file, output_file, downsample_factor=2):
image = pyvips.Image.new_from_file(input_file, access="sequential")
downsampled_image = image.resize(1.0 / downsample_factor)
downsampled_image.write_to_file(output_file, Q=85, tile=True, pyramid=True)
input_tiff = '/path/to/2_CD8.ome.tiff'
output_tiff = '/path/to/2_CD8_downsampled.ome.tiff'
downsample_ome_tiff(input_tiff, output_tiff)
I would like to know if there are any improvements or alternative methods to downsample the OME-TIFF file. Additionally, I need guidance on how to generate patches from the downsampled image for deep learning purposes.
Thank you for your assistance!
Warm regards,
Aobo Tan
Metadata
Metadata
Assignees
Labels
No labels