Class BioimageIoTools
- Since:
- v0.4.0
- Author:
- Pete Bankhead
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DnnModel
buildDnnModel
(qupath.bioimageio.spec.BioimageIoSpec.BioimageIoModel spec) Attempt to build aDnnModel
that follows this spec as closely as possible.static PatchClassifierParams
buildPatchClassifierParams
(qupath.bioimageio.spec.BioimageIoSpec.BioimageIoModel modelSpec, int preferredTileWidth, int preferredTileHeight, ImageOp... inputOps) Create an instance ofPatchClassifierParams
from a model spec.static PatchClassifierParams
buildPatchClassifierParams
(qupath.bioimageio.spec.BioimageIoSpec.BioimageIoModel model, ImageOp... inputOps) Create an instance ofPatchClassifierParams
from a model spec.static ImageOp
transformsToOp
(Collection<? extends qupath.bioimageio.spec.BioimageIoSpec.Processing> transforms) Create anImageOp
that applies the specified transforms sequentially.static ImageOp
transformToOp
(qupath.bioimageio.spec.BioimageIoSpec.Processing transform) Create anImageOp
that applies the specified transforms, if possible.
-
Constructor Details
-
BioimageIoTools
public BioimageIoTools()
-
-
Method Details
-
buildDnnModel
Attempt to build aDnnModel
that follows this spec as closely as possible.In some instances, the processing steps requires by the spec might not currently be supported by QuPath - see
transformToOp(Processing)
for more information.- Parameters:
spec
-- Returns:
-
buildPatchClassifierParams
public static PatchClassifierParams buildPatchClassifierParams(qupath.bioimageio.spec.BioimageIoSpec.BioimageIoModel model, ImageOp... inputOps) Create an instance ofPatchClassifierParams
from a model spec. This encapsulates some key information QuPath needs for building a model in a way that can be modified and updated according to user requirements.- Parameters:
model
- the model spec to initialize the parametersinputOps
- optional additional preprocessing ops to apply, before any in the model spec are added- Returns:
-
buildPatchClassifierParams
public static PatchClassifierParams buildPatchClassifierParams(qupath.bioimageio.spec.BioimageIoSpec.BioimageIoModel modelSpec, int preferredTileWidth, int preferredTileHeight, ImageOp... inputOps) Create an instance ofPatchClassifierParams
from a model spec. This encapsulates some key information QuPath needs for building a model in a way that can be modified and updated according to user requirements.- Parameters:
modelSpec
- the model spec to initialize the parameterspreferredTileWidth
- preferred tile width, or -1 to automatically determine this; the width will be updated based on the specpreferredTileHeight
- preferred tile height, or -1 to automatically determine this; the height will be updated based on the specinputOps
- optional additional preprocessing ops to apply, before any in the model spec are added- Returns:
-
transformsToOp
public static ImageOp transformsToOp(Collection<? extends qupath.bioimageio.spec.BioimageIoSpec.Processing> transforms) Create anImageOp
that applies the specified transforms sequentially.Important! This method is experimental and subject to change in future versions.
Not all Bioimage Model Zoo transforms are supported by QuPath ops, and ops are generally per tile whereas model zoo transforms sometimes require global statistics (e.g. for normalization).
This method will make an attempt to return a suitable op, but it may not be able to incorporate all steps.
- Parameters:
transforms
-- Returns:
-
transformToOp
Create anImageOp
that applies the specified transforms, if possible.Important! This method is experimental and subject to change in future versions.
Not all Bioimage Model Zoo transforms are supported by QuPath ops, and ops are generally per tile whereas model zoo transforms sometimes require global statistics (e.g. for normalization).
This method will make an attempt to return a suitable op, but may return null if no such op is available.
- Parameters:
transform
-- Returns:
-