fast::TissueSegmentation class

Segment tissue from a WSI.

Uses the GPU to perform a simple threshold-based tissue/glass segmentation of a WSI. Since glass is almost white, the threshold is the distance from the pixels color to white (255,255,255). A morphological closing (dilation+erosion) is performed after thresholding.

Inputs:

Outputs:

  • 0: Segmentation tissue mask

Base classes

class ProcessObject
Abstract base class for all process objects.

Public functions

auto create(bool useColorThresholdingMethod, int level, float magnification, int threshold, int dilationSize, int erosionSize, bool filterZeros) -> std::shared_ptr<TissueSegmentation>
auto getThreshold() const -> int
void setDilate(int radius)
auto getDilate() const -> int
void setErode(int radius)
auto getErode() const -> int
void setFilterZeros(bool value)
auto getFilterZeros() const -> bool
void setLevel(int level)
auto getLevel() const -> int
void setMagnification(float magnification)
auto getMagnification() const -> float
void setUseColorThresholdingMethod(bool use)
auto getUseColorThresholdingMethod() const -> bool
void loadAttributes() override

Protected functions

void execute() override
void runNeuralNetwork(SpatialDataObject::pointer image)
void runColorThresholding(SpatialDataObject::pointer image)

Function documentation

std::shared_ptr<TissueSegmentation> fast::TissueSegmentation::create(bool useColorThresholdingMethod, int level, float magnification, int threshold, int dilationSize, int erosionSize, bool filterZeros)

Parameters
useColorThresholdingMethod Whether to use a simple color thresholding method or a neural network to segment tissue
level Level to run neural network on. Only used if magnification <= 0
magnification Magnification to run neural network on.
threshold Threshold for distance from white (255,255,255) to be considered as tissue.
dilationSize Size of dilation to perform after thresholding
erosionSize Size of erosion to perform after thresholding
filterZeros
Returns A tissue segmentation instance Set single threshold for pixel filtering based on the distance a RGB-triplet is from the color white. Default is 85

Create an instance of TissueSegmentation

int fast::TissueSegmentation::getThreshold() const

Get current threshold value

void fast::TissueSegmentation::setDilate(int radius)

Parameters
radius

Set radius for disk used in morphological dilation. Default is 9

int fast::TissueSegmentation::getDilate() const

Get current dilation value

void fast::TissueSegmentation::setErode(int radius)

Parameters
radius

Set radius for disk used in morphological erosion. Default is 9

int fast::TissueSegmentation::getErode() const

Get current erosion value

void fast::TissueSegmentation::setFilterZeros(bool value)

Set status for filtering zero uints.

bool fast::TissueSegmentation::getFilterZeros() const

Get current status whether to include zero uints into background class or not. Default is true