Skip to content

ntnu-mr-cancer/SegmentationQualityControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Segmentation Quality Control System

A quality control system for automated prostate segmentation on T2-weighted MRI

This is a fully automated quality control system that generate a quality score for assessing the accuracy of automated prostate segmentations on T2W MR imagese.

This fully automated quality control system employs radiomics features for estimating the quality of deep-learning based prostate segmentation on T2W MR images. The performance of our system is developed and tested using two data cohorts and 4 different deep-learning based segmentation algorithms

The method was developed at the MR Cancer group at the Norwegian University of Science and Technology (NTNU) in Trondheim, Norway. https://www.ntnu.edu/isb/mr-cancer

For detailed information about this method, please read our paper: https://www.mdpi.com/2075-4418/10/9/714

Note

The provided algorithm was developed for research use and was NOT meant to be used in clinic.

How to cite the system

In case of using or refering to this system, please cite it as:

Sunoqrot, M.R.S.; Selnæs, K.M.; Sandsmark, E.; Nketiah, G.A.; Zavala-Romero, O.; Stoyanova, R.; Bathen, T.F.; Elschot, M. A Quality Control System for Automated Prostate Segmentation on T2-Weighted MRI. Diagnostics 2020,10, 714. https://doi.org/10.3390/diagnostics10090714

Python Version

For the Python Version/Package(pyPSQC) Check this repository: https://github.com/MohammedSunoqrot/pyPSQC . You can install the package either from pip or using pip pip install pyPSQC or the files in GitHub repository [https://github.com/MohammedSunoqrot/pyPSQC]

How to use the system

This is a MATLAB® function, the function was written and tested using MATLAB® R2019b.

To run the function you can use the SQC.m file and make sure to install the trained model "trainedModel.mat", 'pyradiomicsFeatureExtraction.py', the Dependency folder and prepare python environment. In addition, you have to install the requisted third party toolboxes as desciped in the Dependency section below.

Make sure that all of these files are in the same folder.

To use the function, you simply have to provide the full directories (string) to your scan and segmentation (DICOM foldr or MetaIO (.mha/.mhd)) image as an input to the SQC function. You also need to specify if your scan normalized using AutoRef or not and you need to set a threshould to distinguish the acceptable and not acceptable segmentations.

[qualityScore,qualityClass] = SQC(scanPath,segPathIn,normStatus,qualityClassThr);

Input:

1- scanPath: The path of the Image you run the segmentation on.The scan must be in .mhd, .mha, .mat or DICOM format. (string)

2- segPath: The path of the resulted segmentation.The segmentation must be in .mhd, .mha, .mat or DICOM format. (string)

3- normStatus: You have to set a number (1,2 or 3). (numeric)

4- qualityClassThr: The threshould, which any qualityScore less than it would be considered NOT acceptable, and any value eqault or higher than it will be considered Acceptable. (numeric)

Output:

1- qualityScore: The segmentation quality score. (numeric)

2- qualityClass: The segmentaion quality class. (string)

Example for unnormalized scan with DICOM format:

Let say you have a the images resulted from an unnormalized T2-weighted MRI scan of the prostate (Case10) and the segmentation of that scan (Case10_segmentation) in DICOM format (3D image). And let assume that you want to concider any quality score more than 85 acceptable. Then you have to type this:

scanPath = 'C:\Data\Case10';
segPath = 'C:\Data\Case10_segmentation';
[qualityScore,qualityClass] = SQC(scanPath,segPath,1,85)

Example for unnormalized scan with MetaIO format:

Let say you have a the images resulted from an unnormalized T2-weighted MRI scan of the prostate (Case10) and the segmentation of that scan (Case10_segmentation) in MetaIO format (3D image). And let assume that you want to concider any quality score more than 85 acceptable. Then you have to type this:

scanPath = 'C:\Data\Case10.mhd';
segPath = 'C:\Data\Case10_segmentation.mhd';
[qualityScore,qualityClass] = SQC(scanPath,segPath,1,85)

Example for normalized scan with AutoRef normalization method:

Let say you have a the images resulted from a normalized T2-weighted MRI scan of the prostate (Case10_normalized) and the segmentation of that scan (Case10_segmentation) in MetaIO format (3D image). And let assume that you want to concider any quality score more than 85 acceptable. Then you have to type this:

scanPath = 'C:\Data\Case10_normalized.mhd';
segPath = 'C:\Data\Case10_segmentation.mhd';
[qualityScore,qualityClass] = SQC(scanPath,segPath,2,85)

Example for normalized scan with AutoRef normalization method that sved as .mat:

Let say you have a the images resulted from a normalized T2-weighted MRI scan of the prostate (Case10_normalized), which was saved as .mat, and the segmentation of that scan (Case10_segmentation) in MetaIO format (3D image). And let assume that you want to concider any quality score more than 85 acceptable. Then you have to type this:

scanPath = 'C:\Data\Case10_normalized.mat';
segPath = 'C:\Data\Case10_segmentation.mhd';
[qualityScore,qualityClass] = SQC(scanPath,segPath,3,85)

Dependency

This function depend on the followings, which you should make sure that you have correctly installed them on your computer:

  1. AutoRef normalization method by MR Cancer Group at NTNU Trondheim, Norway https://github.com/ntnu-mr-cancer/AutoRef
  1. JSONLab toolbox (version 1.5): by: Qianqian Fang, Northeastern University, MA, USA.
  • It is included in the Dependency folder.
  1. Python environment with Pyradiomics (V 2.2) and python (3.7). (possibly will work with Pyradiomics (V 3.0) and python (3.6/3.5), but not tested). Pyradiomics is by: Computational Imaging & Bioinformatics Lab. Harvard Medical School, MA , USA. https://pyradiomics.readthedocs.io/en/2.2.0/

Tips

If you want to recall a specific python environment from Anaconda: At the begning of your script set the environment path from Anaconda

setenv('PATH','/mnt/work/software/Anaconda/anaconda3/envs/qcs/bin');

and after you finish with runing the SQC function you type

setenv('PATH','/usr/bin'); % Only if you are using linux, if you are using windows don't type this line
restoredefaultpath;
rehash toolboxcache;
savepath

Retrain the system

If you want to retrain the sytem follow the instructions in "Retrain" https://github.com/ntnu-mr-cancer/SegmentationQualityControl/tree/master/Retrain

There you will find a detailed desctiotion and all the codes you need to do the training.

Contact us

Feel free to contact us: [email protected]