I have WSI of Breast cancer and I want to run them through custom models and make heatmap #181
-
This repo looks like one of the most promising solutions to WSI processing. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 22 replies
-
Hello, @lomshabhishek! There is a comprehensive tutorial on how to get started using If you just care about running your model on new WSIs and visualize the predictions on top of the WSI, I could recommend FastPathology. |
Beta Was this translation helpful? Give feedback.
-
import fast Download a nuclei segmentation model from the DataHubmodel = fast.DataHub().download('nuclei-segmentation-model') importer = fast.WholeSlideImageImporter.create( tissueSegmentation = fast.TissueSegmentation.create() generator = fast.PatchGenerator.create( segmentation = fast.SegmentationNetwork.create( exporter = fast.TIFFImagePyramidExporter.create('segmented-nuclei-result_2.tiff') import fast Run importer and get dataimagePyramid = fast.TIFFImagePyramidImporter Extract specific level as FAST imageimage = imagePyramid.getAccess(fast.ACCESS_READ).getLevelAsImage(level=2) Convert FAST image to numpy ndarray and plotimage = np.asarray(image) This should print: (2664, 3222, 3) uint8 255 0print(image.shape, image.dtype, np.max(image), np.min(image)) plt.imshow(image) |
Beta Was this translation helpful? Give feedback.
Great! In that case, the final step is using
matplotlib
. Hence, you have managed to do all relevant steps withpyFAST
.See my comment above for how to plot the WSI and prediction image side-by-side: #181 (reply in thread)
To plot the generated segmentation as overlay on top of the low-resolution WSI, see this thread.
Note that to plot segmentation on top of the low-res WSI, they likely need to be of equal image size. This can be achieved using
OpenCV
's resize function.To save a figure in matplotlib, see savefig.
As the final steps are not FAST-related, I will let you try that on your own. Best of luck! :]
As you are now able to generate and view the heatmap using pyFAST, which was the or…