-
Notifications
You must be signed in to change notification settings - Fork 1
Home
abhivanth edited this page Aug 16, 2020
·
7 revisions
- Update the path and the directory in the below mentioned variables
- GE3T_DIR = ‘P:\Clean_Datasets_Backup\WMH\Amsterdam_GE3T\GE3T’ # Example path
- SINGAPORE_DIR = 'P:\Clean_Datasets_Backup\WMH\Singapore\Singapore' # Example path
- UTRECHT_DIR = 'P:\Clean_Datasets_Backup\WMH\Utrecht\Utrecht' # Example path
- Execute the code - Only the 'preprocessing.py'
- The normalised preprocessed images will be stored in the folders (dir_input, dir_output)
- The preprocessed images will be sliced with respect to the z-direction and stored in the folders (out_dir_groudtruth_slices, out_dir_input_slices)
- The data dump will be stored locally as 'data_tensor.sav' file
- Execute the code - Only the 'train_network.py' (no changes required) Note: For each hospital, only 17 out of 20 images were used for training the network, the other 3 were used for testing or validation
- The model will be trained(200 epochs) and for each epoch, the model will save a 'checkpoint.pth.tar' file in checkpoints folder
- The losses for corresponding epoch will be saved locally in a text file as 'plot_loss.txt'
- Convert the 'plot_loss.txt' file to 'epoch_losses.csv' manually by removing the square brackets from the text file (Reference files are provided)
- Execute the code - Only the 'plot_result.py' (verify the input filename and no changes are required)
- The graph will be plotted and it will be saved locally as a .png file 'epoch_losses.png'
- Update the test_subject = ‘P:\Clean_Datasets_Backup\WMH\Utrecht\Utrecht\49' # Example path
- Choose the best 'checkpoint.pth.tar' file and update the path = 'checkpoints\checkpoint_75.pth.tar' # Example
- Two files will be saved locally as 'prefix_predicted.nii' and 'prefix_actual.nii' (prefix denotes test subject folder name, in this case it is '49_predicted.nii' and '49_actual.nii')