Skip to main content

Original package to support Region Adaptive Magnetic Resonance Image Enhancement for improving CNN based segmentation of the prostate and prostatic zones paper

Project description

Region Adaptive Magnetic Resonance Image Enhancement for improving CNN based segmentation of the prostate and prostatic zones

The current repo supports the Nature's Scientific report original publication
"Region-Adaptive Magnetic Resonance Image Enhancement for improving CNN-based segmentation of the prostate and prostatic zones", doi:10.1038/s41598-023-27671-8

The algorithm has been implemented to enhance the prostate's Whole Gland in T2-Weighted MR images. The repo contains 2 packages

  • Testing_Utils for instant usability on Prostate MR images (Demo_Testing_on_MRI_Prostate_Data.ipynb consists an example of utilization)
  • Training_Utils for training a bounding box proposal network on your data (Demo_Training_Process.ipynb consists an example of training your bounding box proposal network)

Installation

In order to Utilize the project

  • install the requirements.txt via pip
  pip install requirements.txt

Download the Training_Utils and Testing_Utils folders into your project and import them in a python editor (jupyter notebook, VScode etc.)

import Training_Utils,Testing_Utils

Abstract

Automatic segmentation of the prostate of and the prostatic zones on MRI remains one of the most compelling research areas. While different image enhancement techniques are emerging as powerful tools for improving the performance of segmentation algorithms, their application still lacks consensus due to contrasting evidence regarding performance improvement and cross-model stability, further hampered by the inability to explain models’ predictions. Particularly, for prostate segmentation, the effectiveness of image enhancement on different Convolutional Neural Networks (CNN) remains largely unexplored. The present work introduces a novel image enhancement method, named RACLAHE, to enhance the performance of CNN models for segmenting the prostate’s gland and the prostatic zones. The improvement in performance and consistency across five CNN models (U-Net, U-Net++, U-Net3+, ResU-net and USE-NET) is compared against four popular image enhancement methods. Additionally, a methodology is proposed to explain, both quantitatively and qualitatively, the relation between saliency maps and ground truth probability maps. Overall, RACLAHE was the most consistent image enhancement algorithm in terms of performance improvement across CNN models with the mean increase in Dice Score ranging from 3% to 9% for the different prostatic regions, while achieving minimal inter-model variability. The integration of a feature driven methodology to explain the predictions after applying image enhancement methods, enables the development of a concrete, trustworthy automated pipeline for prostate segmentation on MR images.

Acknowledgements

  • This work is supported by the ProCancer-I project, funded by the European Union’s Horizon 2020 research and innovation program under grant agreement No 952159. It reflects only the author's view. The Commission is not responsible for any use that may be made of the information it contains.

Authors

Badges

MIT License Python

ProCAncer AI

Usage/Examples

from Testing_Utils.Raclahe_Process import * # import the package

pat_name    = "Example" 
w_p         = "Path/to/Weights/bbox_weights.h5"
path_inp    = "Path/To/Folder" # Folder includes patients in nifti format
user_output = "Path/To/Save_Folder" # folder to save the Raclahe operation outcome in nifti format
Raclahe_enhanced_patients = Raclahe_process_nifti(pat_name,w_p,path_inp,user_output)
  • An example for training your own region proposal model on your dataset could be found at the Demo_Training_Process.ipynb also
from Training_Utils import * # import the package

pats = nib.load("Path/to/patients")
labs = nib.load("Path/to/labels")

pats_process = Bounding_Box_Operations.Bounding_Box_Preprocessing(pats,labs).resize(256,256,anno=False) # resize to 256x256
pats_process = Bounding_Box_Operations.Bounding_Box_Preprocessing(pats_process,labs).norm8bit() # Normalize to 8Bit
pats_process = Bounding_Box_Operations.Bounding_Box_Preprocessing(pats_process,labs).Standardization(min_max=True) # Standardize for the training process
pats_process,labs_process,_,bbox = Bounding_Box_Operations.Bounding_Box_Preprocessing(pats_process,labs).bounding_box_creation(size=30,path="",extract_bounding=False) # creation of the bounding box
bbox = Bounding_Box_Operations.Bounding_Box_Preprocessing(_,bbox).resize(256,256,anno=True) # resize the bounding box to 256x256

Bounding_Box_Operations.model_training(data_train=pats[:300],labels_train=bbox[:300],
                                       data_val=pats[300:350],labels_val=bbox[300:350],
                                       save_weights_path="Path/To/Save_the_Weights")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

raclahe-0.1.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

raclahe-0.1.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file raclahe-0.1.2.tar.gz.

File metadata

  • Download URL: raclahe-0.1.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.13 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.13

File hashes

Hashes for raclahe-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fc65f49fcc9aefe54884a0c2e5dd72e52e532d2f74abe35331e11517158dd384
MD5 44c3bb3966d7ca90afc8171af81da1d8
BLAKE2b-256 377a25bef0e431ad63852027b656fe58c580507925e096be3816b963f30f112e

See more details on using hashes here.

File details

Details for the file raclahe-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: raclahe-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.13 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.13

File hashes

Hashes for raclahe-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 52f24a8930df435c5fd59348149e5c14858084f9be5e88ff962e93c1f65745a9
MD5 98696f9812c5e312504c0817951be45b
BLAKE2b-256 cfd84bd92273d92b68ca585966260adc6d647f5c84a41aba5520f0468ee1ae23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page