Stain Normalisation using Sparse Auto-Encoders. Implemented as close to the paper as possible.
(I use Ubuntu 16.04, so the following instructions are tailored for it. If you are using a different OS, you may have to change these accordingly)
- If you don't have Anaconda, download and install Anaconda as per the instructions for your OS.
- Create environment and install the dependencies
conda create --name stanosa python=3.6 --file req.txt
- Activate the environment
source activate stanosa
Note: if you experience anything like "conda: command not found" then just restart your terminal.
Configuration is done in "stanosa.conf".
Ensure that your training images are all stored directory under the folder specified in the data_path variable in the stanosa.conf file.
When ready, simply run:
python train.py
Model states will be saved to "$output_path/states".
As before, ensure all testing images are under the data_path variable (in the [testing] section). Make sure you set the state_path variable properly so the weights are loaded from training.
Testing will take each image under the testing data path and pass it through the encoder, patch-by-patch and then applies clustering to the activations. The output of the clustering as well as the activations will be stored in a folder with the same name as the image.
When ready:
python test.py