Package qupath.lib.images.writers.ome
Class OMEPyramidWriter
java.lang.Object
qupath.lib.images.writers.ome.OMEPyramidWriter
Write OME-TIFF files based on QuPath ImageServers.
 
The files may optionally be pyramidal TIFFs. Some key metadata is set (e.g. channel names/colors, pixel size), and an effort is made to support multidimensional images - but this has not been extensively checked.
Currently the magnification is not written, nor is the full OME XML metadata, and images written using this class should not be assumed to contain all the necessary information, correctly or at all (i.e. always keep your original data files!).
Note this requires Bio-Formats v6.0.0 or later.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classBuilder class to define parameters when exporting an image region as OME-TIFF, possibly as an image pyramid.static enumEnum representing different ways in which channels may be written to a file.static enumPreferred compression type when using Bio-Formats.static classClass representing a single series to write to an OME-TIFF.
- 
Method SummaryModifier and TypeMethodDescriptionstatic OMEPyramidWriterCreate a writer capable of writing an image with a collection of series.static OMEPyramidWritercreateWriter(OMEPyramidWriter.OMEPyramidSeries... series) Create a writer capable of writing an image with one or more series.voidwriteImage(String path) Write an image consisting of one or more series to the specified path.static voidwriteImage(ImageServer<BufferedImage> server, String path) Static helper method to write an image using Bio-Formats.static voidwriteImage(ImageServer<BufferedImage> server, String path, OMEPyramidWriter.CompressionType compression) Static helper method to write an image using Bio-Formats with the specified compression.static voidwriteImage(ImageServer<BufferedImage> server, String path, OMEPyramidWriter.CompressionType compression, ImageRegion region) Static helper method to write an image region using Bio-Formats with the specified compression.static voidwriteImage(ImageServer<BufferedImage> server, String path, OMEPyramidWriter.CompressionType compression, ImageRegion region, boolean allZ, boolean allT) Static helper method to write an image using Bio-Formats for a defined region with the specified compression, optionally including all z-slices or timepoints.
- 
Method Details- 
writeImageWrite an image consisting of one or more series to the specified path.- Parameters:
- path-
- Throws:
- FormatException
- IOException
- See Also:
 
- 
createWriterCreate a writer capable of writing an image with one or more series.- Parameters:
- series-
- Returns:
 
- 
createWriterCreate a writer capable of writing an image with a collection of series.- Parameters:
- series-
- Returns:
 
- 
writeImagepublic static void writeImage(ImageServer<BufferedImage> server, String path) throws FormatException, IOException Static helper method to write an image using Bio-Formats. This is primarily intended for saving whole slide images as pyramidal OME-TIFF, but other formats are supported.- Parameters:
- server-
- path-
- Throws:
- FormatException
- IOException
 
- 
writeImagepublic static void writeImage(ImageServer<BufferedImage> server, String path, OMEPyramidWriter.CompressionType compression) throws FormatException, IOException Static helper method to write an image using Bio-Formats with the specified compression. This is primarily intended for saving whole slide images as pyramidal OME-TIFF, but other formats are supported.- Parameters:
- server-
- path-
- compression-
- Throws:
- FormatException
- IOException
 
- 
writeImagepublic static void writeImage(ImageServer<BufferedImage> server, String path, OMEPyramidWriter.CompressionType compression, ImageRegion region) throws FormatException, IOException Static helper method to write an image region using Bio-Formats with the specified compression. If region is null, the entire image will be written. If region is not null, it defines the bounding box of the exported pixels in addition to the z-slice and timepoint.- Parameters:
- server- image to write
- path- path to output file
- compression- image compression method; may be null to use the default compression
- region- the region to export. If this is a RegionRequest that defines a downsample other than the default for the server, this downsample will be used.
- Throws:
- FormatException
- IOException
 
- 
writeImagepublic static void writeImage(ImageServer<BufferedImage> server, String path, OMEPyramidWriter.CompressionType compression, ImageRegion region, boolean allZ, boolean allT) throws FormatException, IOException Static helper method to write an image using Bio-Formats for a defined region with the specified compression, optionally including all z-slices or timepoints. This is intended primarily to write (possibly pyramidal) OME-TIFF images; other formats may support fewer image types and dimensions.- Parameters:
- server- image to write
- path- path to output file
- compression- image compression method; may be null to use the default compression
- region- the region to export. If this is a RegionRequest that defines a downsample other than the default for the server, this downsample will be used.
- allZ- if true, export all z-slices otherwise export slice defined by region (ignored if image is not a z-stack)
- allT- if true, export all timepoints otherwise export timepoint defined by region (ignored if image is not a timeseries)
- Throws:
- FormatException
- IOException
 
 
-