Skip to content

ul-mds/defacing-evaluation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Defacing Evaluation Pipeline


Setup

With Pip virtualenv

  • 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

With Miniconda

Install Miniconda

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

Create and activate environment

  > conda create --name defacing
  > conda activate defacing
  > conda install python=3.12

Install requirements

  > cd defacing_evaluation/
  > pip install -r requirements.txt
  > pip install --upgrade pyvista

Data import

Run the following commands from the repository folder.

Generation overview CSV

  • 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.csv 
    

    Continued 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

Import data

> python3 src/main.py step1_import --overview_csv specify_overview_file_path.csv

Defacing

> python3 src/main.py step2

Evaluation

Collect features

> python3 src/main.py step3_1

Manual groundtruth labelling

> python3 src/main.py step3_2

Machine Learning Modelling

  • 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
    

Visuals

Visual scripts are not integrated in main.py. Please run them individually as needed.

Troubleshooting

  • 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published