The patch generator tiles an ImagePyramid or 3D image into equal sized patches. Although the patches can be smaller at the edges if the image size is not dividable by the patch size. The result of the processed patches can be stitched together again to form a full ImagePyramid/3D Image/Tensor by using the PatchStitcher.
- auto create(int width, int height, int depth, int level, int magnification, float overlapPercent, float maskThreshold, int paddingValue) void setPatchSize(int width -> std::shared_ptr<PatchGenerator>
- Creates a PatchGenerator instance.
- void setOverlap(float percent)
- void setPatchLevel(int level)
- void setPatchMagnification(int magnification)
- void setMaskThreshold(float percent)
- void setPaddingValue(int paddingValue)
- void loadAttributes() override
- auto getProgress() -> float
- Get progress of this patch generator in percent.
PatchGenerator:: create(int width,
int paddingValue) void setPatchSize(int width
Creates a PatchGenerator instance.
|width||Width of patch (Note: patches can be smaller at boundaries and will be padded)|
|level||Which level of an ImagePyramid to generate patches from.|
|magnification||Which magnification to extract patches from. Setting this value for instance to 20, will trigger a search through all levels to find the image pyramid level which is closest to 20X magnification, 0.0005 mm pixel spacing. If no such level exist an exception is thrown. This parameter overrides the level parameter.|
|overlapPercent||Amount of patch overlap in percent.|
|maskThreshold||Threshold to accept a patch if the additional mask is provided.|
|paddingValue||Value to pad patches with when out-of-bounds. Default is negative, meaning it will use (white)255 for color images, and (black)0 for grayscale images|
PatchGenerator:: setOverlap(float percent)
Set overlap of generated patches, in percent of patch size.
Get progress of this patch generator in percent.
|Returns||progress in percent 0.0-1.0|
PatchGenerator:: generateStream() override protected
The function producing the data stream