Class SimpleTiledWriter
java.lang.Object
SimpleTiledWriter
Example class for reading a full image and use an OME-Tiff writer to
automatically write out the image in a tiled format.
- Author:
- David Gault dgault at dundee.ac.uk
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleTiledWriter(String inputFile, String outputFile, int tileSizeX, int tileSizeY) Construct a new SimpleTiledWriter to read the specified input file and write the given output file using the tile sizes provided. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidTo read an image file and write out an OME-Tiff tiled image on the command line: $ java SimpleTiledWriter input-file.oib output-file.ome.tiff 256 256voidSet up the file reader and writer, ensuring that the input file is associated with the reader and the output file is associated with the writer.
-
Constructor Details
-
SimpleTiledWriter
Construct a new SimpleTiledWriter to read the specified input file and write the given output file using the tile sizes provided.- Parameters:
inputFile- the file to be readoutputFile- the file to be writtentileSizeX- the width of tile to attempt to usetileSizeY- the height of tile to attempt to use
-
-
Method Details
-
readWriteTiles
public void readWriteTiles() throws loci.formats.FormatException, loci.common.services.DependencyException, loci.common.services.ServiceException, IOExceptionSet up the file reader and writer, ensuring that the input file is associated with the reader and the output file is associated with the writer. The input reader will read a full plane which will then be passed to the OME-Tiff Writer. The writer will then automatically write the image in a tiled format based on the tile size values provided.- Throws:
loci.formats.FormatException- thrown when setting invalid values in reader or writerloci.common.services.DependencyException- thrown if failed to create an OMEXMLServiceloci.common.services.ServiceException- thrown if unable to create OME-XML meta dataIOException- thrown if unable to setup input or output stream for reader or writer
-
main
public static void main(String[] args) throws loci.formats.FormatException, IOException, loci.common.services.DependencyException, loci.common.services.ServiceException To read an image file and write out an OME-Tiff tiled image on the command line: $ java SimpleTiledWriter input-file.oib output-file.ome.tiff 256 256- Parameters:
args- inputFile, outputFile, tileSizeX and tileSizeY- Throws:
IOException- thrown if unable to setup input or output stream for reader or writerloci.formats.FormatException- thrown when setting invalid values in reader or writerloci.common.services.ServiceException- thrown if unable to create OME-XML meta dataloci.common.services.DependencyException- thrown if failed to create an OMEXMLService
-