-
Notifications
You must be signed in to change notification settings - Fork 108
Description
import fast
Download a nuclei segmentation model from the DataHub
model = fast.DataHub().download('nuclei-segmentation-model')
importer = fast.WholeSlideImageImporter
.create(fast.Config.getTestDataPath() + "/WSI/CMU-1.svs")
tissueSegmentation = fast.TissueSegmentation.create()
.connect(importer)
Generate 256x256 patches at 20X magnification with 10% overlap
generator = fast.PatchGenerator.create(
256, 256,
magnification=20,
overlapPercent=0.1
).connect(importer)
.connect(1, tissueSegmentation)
segmentation = fast.SegmentationNetwork.create(
model.paths[0] + '/high_res_nuclei_unet.onnx',
scaleFactor=1./255.
).connect(generator)
stitcher = fast.PatchStitcher.create()
.connect(segmentation)
Display the stitched segmentation results on top of the WSI
renderer = fast.ImagePyramidRenderer.create()
.connect(importer)
segmentationRenderer = fast.SegmentationRenderer.create()
.connect(stitcher)
fast.SimpleWindow2D.create()
.connect(renderer)
.connect(segmentationRenderer)
.run()
the displayed image is not the same as that in the tutorial, I get the only WSI instead of nuclei.