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 thresold is the distance from the pixels color to white (255,255,255). A morphological closing (dilation+erosion) is performed after thresholding.



  • 0: Segmentation tissue mask

Base classes

class ProcessObject
Abstract base class for all process objects.

Public functions

auto create(int threshold, int dilationSize, int erosionSize) -> 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 loadAttributes() override

Protected functions

void execute() override

Function documentation

std::shared_ptr<TissueSegmentation> fast::TissueSegmentation::create(int threshold, int dilationSize, int erosionSize)

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
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)


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)


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

int fast::TissueSegmentation::getErode() const

Get current erosion value