This Github repo contains a cleaned up version of the code used for the paper Establishing a relationship between iron-based blood measures and structural brain changes using neural networks in UK Biobank
Please go through the steps below to ensure that the code will run properly.
- Prepare your dataset of SWI brain images. The images should be in a single directory, and of pixel size (182, 218, 182).
- In
final_main.py, adapt the model and file directories according to your storage structure - In
final_run.sh, it is possible to choose the iron modeality to predict, the label file path, and the chosen subgroup using the flag options.
To properly run the code, simply run the final run script using bash final_run.sh (or use nohup bash final_run.sh &> final_no_hup.out &, in case you want to run in the background).
To generate various kinds of attention maps, run the image averaging script img_avg.sh in the folder /results.
Please carefully investigate variables and file paths in the called python file results/image_averaging.py, as they are very specific to both the data set and storage locations.
If you like our work and would like to use it in your own academic research, please cite the following: Sammet et al. (2024). Establishing a relationship between iron-based blood measures and structural brain changes using neural networks in UK Biobank. [10.1101/2024.12.13.24318981].