You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ome-codecs-1.0.0 (used in QuPath 0.5.0) supports adjustable jpegquality.
In ome-codecs-1.0.1 the chroma subsampling can be activated/deactivated.
To support these options in QuPath, some changes must be made in QuPath.
Here is a description of the changes required:
The parameters jpegquality and disableChromaSubsampling are set in a CodecOptions object.
This CodecOptions object is used by the TiffWriter (e.g. in the writeImage() function in the OMEPyramidWriter).
It must be 'activated' by calling tiffWriter.setCodecOptions(options);
In QuPath, a possibility must be created to pass this CodecOptions object to the OMEPyramidWriter and finally to the writeImage() function.
Here is a script that shows how the basic call could look like:
import qupath.lib.images.writers.ome.OMEPyramidWriter
import ome.codecs.CodecOptions
// *** THIS IS NEW ***
CodecOptions options = new CodecOptions()
options.quality = 0.95
def imageData = getCurrentViewer().getImageData()
def server = imageData.getServer()
def name = getProjectEntry().getImageName()
def pathOutput = "E:\\tmp\\" + name + ".ome.tif"
def writer = new OMEPyramidWriter.Builder(server)
// THIS IS THE MISSING LINK !
.setCodecOptions(options)
.compression(OMEPyramidWriter.CompressionType.JPEG)
.tileSize(512)
.scaledDownsampling(30, 2)
.build()
.writePyramid(pathOutput)
println 'Done'
The ome-codecs-1.0.0 (used in QuPath 0.5.0) supports adjustable jpegquality.
In ome-codecs-1.0.1 the chroma subsampling can be activated/deactivated.
To support these options in QuPath, some changes must be made in QuPath.
Here is a description of the changes required:
jpegquality
anddisableChromaSubsampling
are set in aCodecOptions
object.CodecOptions
object is used by the TiffWriter (e.g. in thewriteImage()
function in the OMEPyramidWriter).It must be 'activated' by calling
tiffWriter.setCodecOptions(options);
CodecOptions
object to the OMEPyramidWriter and finally to thewriteImage()
function.Here is a script that shows how the basic call could look like:
Here are links to the PRs:
ome/ome-codecs#26
ome/ome-codecs#29
Is it useful and feasible to support these two options in QuPath?
The text was updated successfully, but these errors were encountered: