This script takes Whole Slide Image (WSI), in the form of SVS/NDPI image, uses Vahadane stain transfer and reconstitutes the WSI.
Install staintools from here: https://github.com/Peter554/StainTools/
Change and Run main_all.py to transfer target stain to all SVS images in one directory.
Change and Run main.py to transfer stain to one SVS image.
Sample run:
/home/saurav/anaconda3/bin/python /mnt/c/Users/Saurav/Documents/MSDS/git/wsi_stain_transfer/main.py
Is pickle file for patches present: False
Creating patches for image: 16_002
Dimensions of image x: 5321 and y: 5413
Number of patches created: 36
Transferring target stain to image patches...
Reconstructing and saving the image...