Package qupath.lib.images.writers
Interface ImageWriter<T>
- Type Parameters:
T
-
- All Known Implementing Classes:
JpegWriter
,OMETiffWriter
,PngWriter
,TiffWriterIJ
,ZipWriterIJ
public interface ImageWriter<T>
Interface for defining class that can write images.
This may not have been a particularly good idea and may change in the future... (e.g. using services?).
As it is, it's best to avoid using it because the design is rather clumsy (and goes back to a day whenever external dependencies were avoided with an enthusiasm that may have been a bit too much).
- Author:
- Pete Bankhead
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
Get the default extension.Get further details of the writer, which may be displayed to a user.Get the file extensions used by the image writer.Get the class of supported images.getName()
Get the name of the image writer.boolean
supportsImageType
(ImageServer<T> server) Test whether images provided by a specified ImageServer can be successfully written.boolean
Returns true if the writer is capable of storing pixel size information.boolean
Returns true if the writer is capable of writing pyramidal images.boolean
Check if writer can handle RGB (it probably can...).boolean
Check if writer can handle multiple timepoints.boolean
Check if writer can handle multiple z-slices.void
writeImage
(ImageServer<T> server, OutputStream stream) Write a full image to a specified output stream.void
writeImage
(ImageServer<T> server, String pathOutput) Write a full image to a specified path.void
writeImage
(ImageServer<T> server, RegionRequest region, OutputStream stream) Write an image region to a specified output stream.void
writeImage
(ImageServer<T> server, RegionRequest region, String pathOutput) Write an image region to a specified path.void
writeImage
(T img, OutputStream stream) Write a full image to a specified output stream.void
writeImage
(T img, String pathOutput) Write a full image to a specified path.
-
Method Details
-
getName
String getName()Get the name of the image writer.- Returns:
-
getExtensions
Collection<String> getExtensions()Get the file extensions used by the image writer. These are returned without the leading 'dot'. In the case where multiple extensions are associated with a file type (e.g. "jpg", "jpeg", "tif", "tiff") the preferred should be returned first;- Returns:
-
getDefaultExtension
Get the default extension. This should be the first returned bygetExtensions()
.- Returns:
-
supportsT
boolean supportsT()Check if writer can handle multiple timepoints.- Returns:
-
supportsZ
boolean supportsZ()Check if writer can handle multiple z-slices.- Returns:
-
supportsRGB
boolean supportsRGB()Check if writer can handle RGB (it probably can...).- Returns:
-
supportsImageType
Test whether images provided by a specified ImageServer can be successfully written.Reasons why it might not be are the number of channels and/or bit-depth.
- Parameters:
server
-- Returns:
-
supportsPyramidal
boolean supportsPyramidal()Returns true if the writer is capable of writing pyramidal images.- Returns:
-
supportsPixelSize
boolean supportsPixelSize()Returns true if the writer is capable of storing pixel size information.- Returns:
-
getDetails
String getDetails()Get further details of the writer, which may be displayed to a user.- Returns:
-
getImageClass
Get the class of supported images.- Returns:
ImageServer.getImageClass()
-
writeImage
Write an image region to a specified path.- Parameters:
server
-region
-pathOutput
-- Throws:
IOException
-
writeImage
Write a full image to a specified path.- Parameters:
img
-pathOutput
-- Throws:
IOException
-
writeImage
Write a full image to a specified path.- Parameters:
server
-pathOutput
-- Throws:
IOException
-
writeImage
void writeImage(ImageServer<T> server, RegionRequest region, OutputStream stream) throws IOException Write an image region to a specified output stream.- Parameters:
server
-region
-stream
-- Throws:
IOException
-
writeImage
Write a full image to a specified output stream.- Parameters:
img
-stream
-- Throws:
IOException
-
writeImage
Write a full image to a specified output stream.- Parameters:
server
-stream
-- Throws:
IOException
-