-
Step 0: Set up virtual environment
> pip3 install virtualenv # or sudo apt install python3-virtualenv > virtualenv .venv > source .venv/bin/activate -
Install cmake
> sudo apt update > sudo apt install cmake -
(If necessary) Install tkinter via system packages
> sudo apt-get install python3-tk -
Install Python dependencies
> pip3 install -r requirements.txt[!IMPORTANT]
-
Configure XNAT access (only needed for data import) Create a .env file in the src/ folder with the following variables: > XNAT_ADDRESS > XNAT_ALIAS > XNAT_SECRET > XNAT_PROJECT
Linux - see Quickinstallation from Miniconda
> mkdir -p ~/miniconda3
> wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
> bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
> rm ~/miniconda3/miniconda.sh
> source ~/miniconda3/bin/activate
> conda init --all
> conda create --name defacing
> conda activate defacing
> conda install python=3.12
> cd defacing_evaluation/
> pip install -r requirements.txt
> pip install --upgrade pyvista
Run the following commands from the repository folder.
-
First use:
> python3 src/main.py step1_overview -
Continued use with existing (unfinished) csv file:
[!TIP] If you run the code again on the same day, you can also omit the filename of the csv.
> python3 src/main.py step1_overview --csv_overviewfile path_to_unfinished_csv_overview.csv -
Use with your own dicom tag csv file:
First use:
> python3 src/main.py step1_overview --csv_dicomtags individual_dicom_taglist.csvContinued use with unfinished csv file:
> python3 src/main.py step1_overview --csv_dicomtags individual_dicom_taglist.csv --csv_overviewfile path_to_unfinished_csv_overview.csv
Caution: The CSV uses the pipe (|) separator
> python3 src/main.py step1_import --overview_csv specify_overview_file_path.csv
> python3 src/main.py step2
> python3 src/main.py step3_1
> python3 src/main.py step3_2
-
Create final dataset from evaluation and feature dataframes
> python3 src/main.py step4_final_dataset -
Inter-Rater Reliability
> python3 src/main.py step4_interrater -
MCCV nested CV
> python3 src/main.py step4_nested_cv
Visual scripts are not integrated in main.py. Please run them individually as needed.
- EOF Errors: If you encounter an EOFError during data loading, the file may be corrupted. The safest approach is to delete the file and reimport it from the source (e.g., XNAT).
- Dependencies: Some dependencies (e.g. tkinter) may require system-level installation or upgrades.