fast::PatchGenerator class

Generates a stream of patches from an ImagePyramid or 3D Image.

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.

Base classes

class Streamer
Abstract base class for all Streamers.

Constructors, destructors, conversion operators

~PatchGenerator()

Public functions

auto create(int width, int height, int depth, int level, float overlapPercent, float maskThreshold) void setPatchSize(int width -> std::shared_ptr<PatchGenerator>
Creates a PatchGenerator instance.
void setOverlap(float percent)
void setPatchLevel(int level)
void setMaskThreshold(float percent)
void loadAttributes() override

Public variables

int height
int int depth

Protected functions

void execute() override
void generateStream() override

Protected variables

int m_width
int m_height
int m_depth
float m_overlapPercent
float m_maskThreshold
std::shared_ptr<ImagePyramid> m_inputImagePyramid
std::shared_ptr<Image> m_inputVolume
std::shared_ptr<Image> m_inputMask
int m_level

Function documentation

std::shared_ptr<PatchGenerator> fast::PatchGenerator::create(int width, int height, int depth, int level, float overlapPercent, float maskThreshold) void setPatchSize(int width

Creates a PatchGenerator instance.

Parameters
width Width of patch (Note: patches can be smaller at boundaries)
height
depth
level Which level of an ImagePyramid to generate patches from.
overlapPercent Amount of patch overlap in percent.
maskThreshold Threshold to accept a patch if the additional mask is provided.
Returns instance

void fast::PatchGenerator::setOverlap(float percent)

Parameters
percent

Set overlap of generated patches, in percent of patch size.

void fast::PatchGenerator::generateStream() override protected

The function producing the data stream