Package qupath.lib.images.writers
Class ImageWriterTools
java.lang.Object
qupath.lib.images.writers.ImageWriterTools
Static methods to access 
ImageWriter objects and write images.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T> List<ImageWriter<T>> getCompatibleWriters(Class<T> imageClass, String ext) Get a list of compatible ImageWriters for a specific image class.static <T> List<ImageWriter<T>> getCompatibleWriters(ImageServer<T> server, String ext) Get a list of compatible ImageWriters compatible with a specific server.static booleanwriteImage(BufferedImage img, String path) Write a 2D image using the default writer based on the file path.static booleanwriteImage(ImageServer<BufferedImage> server, String path) Write a (possibly multidimensional) image region using the default writer based on the file path.static booleanwriteImageRegion(ImageServer<BufferedImage> server, RegionRequest request, String path) Write a 2D image region using the default writer based on the file path.
- 
Constructor Details- 
ImageWriterToolspublic ImageWriterTools()
 
- 
- 
Method Details- 
getCompatibleWritersGet a list of compatible ImageWriters compatible with a specific server.- Type Parameters:
- T-
- Parameters:
- server-
- ext-
- Returns:
- getCompatibleWriters(Class, String)
 
- 
getCompatibleWritersGet a list of compatible ImageWriters for a specific image class.The returned list is sorted, with the 'preferred' server coming first. This decision is made based upon whether the writer supports pixel calibration information and - Type Parameters:
- T-
- Parameters:
- imageClass- the image class (e.g. BufferedImage.class)
- ext- the desired output file extension (e.g. ".jpg", ".tif").
- Returns:
- getCompatibleWriters(ImageServer, String)
 
- 
writeImageRegionpublic static boolean writeImageRegion(ImageServer<BufferedImage> server, RegionRequest request, String path) throws IOException Write a 2D image region using the default writer based on the file path.- Parameters:
- server- the image to write
- request- region to write; if null, the default plane of the entire image will be written
- path- the file path; the extension will be used to identify an appropriate writer
- Returns:
- Throws:
- IOException
 
- 
writeImageWrite a 2D image using the default writer based on the file path.- Parameters:
- img-
- path-
- Returns:
- Throws:
- IOException
 
- 
writeImageWrite a (possibly multidimensional) image region using the default writer based on the file path.- Parameters:
- server- the image to write
- path- the file path; the extension will be used to identify an appropriate writer
- Returns:
- Throws:
- IOException
 
 
-