Skip to main content

Python pakage to perfom AutoRef (prostate T2w MRI dual reference tissue [fat and muscle] normalization).

Project description

pyAutoRef

This is the python version of the "Automated reference tissue normalization of T2-weighted MR images of the prostate using object recognition"

This is an automated method for dual-reference tissue (fat and muscle) normalization of T2-weighted MRI for the prostate.

The method was developed at the CIMORe group at the Norwegian University of Science and Technology (NTNU) in Trondheim, Norway. [https://www.ntnu.edu/isb/cimore]

For detailed information about this method, please read our paper: [https://link.springer.com/article/10.1007%2Fs10334-020-00871-3]

Note

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

Structure

pyAutoRef/
├── LICENSE
├── pyproject.toml
├── README.md
├── setup.cfg
├── src/
│   └── pyAutoRef/
│       ├── __init__.py
│       ├── autoref.py
│       ├── pre_processing.py
│       ├── object_detection.py
│       ├── post_processing.py
│       ├── normalization.py
│       ├── utils.py
│       ├── MANIFEST.in
│       └── model.onnx
└── tests/

Installation

You can install the package either from pip or using pip or the files in GitHub repository [https://github.com/MohammedSunoqrot/pyAutoRef]

pip

Simply type:

pip install pyAutoRef

GitHub

  • Clone the GitHub repository

    From command line

    git clone https://github.com/MohammedSunoqrot/pyAutoRef.git
    
  • Change directory to the clones folder (unzip if needed) and type

    pip install . 
    

Difference Note

This python version is differ than the originally published MATLAB version [https://github.com/ntnu-mr-cancer/AutoRef] in terms:

  • It accepts all kind of SimpleITK supported image format.
  • It uses YOLOv8 model for object detector instead of ACF.

Diviation from the original published, MATLAB-based method

VERSION 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4

  • YOLOv8 model for object detector trained using the same data and bounding boxes used to train ACF in the original/MATLAB code. No Data deviation, but needed to meantioned.
  • The detection was performed on all slices for both fat and muscle.

VERSION 2.0.0

  • YOLOv8 model for object detector trained using images from 823 cases (4 centers, 3 centers data is private and 1 is public which is the PROSTATE158 training dataset) in addition to the same data used to train the original detector.
  • For detection for both fat and muscle the first 15% and the last 15% of slices were not looked at for detection.

How to cite AutoRef/pyAutoRef

In case of using or refering to AutoRef/pyAutoRef, please cite it as:

Sunoqrot, M.R.S., Nketiah, G.A., Selnæs, K.M. et al. Automated reference tissue normalization of T2-weighted MR images of the prostate using object recognition. Magn Reson Mater Phy 34, 309–321 (2021). [https://doi.org/10.1007/s10334-020-00871-3]

How to use pyAutoRef

To perform AutoRef normalization, you first need to import the autoref function. You can do it by calling from pyAutoRef import autoref

autoref Function

  • Parameters: input_image_path (str): The file path to the input 3D image (any supported SimpleITK format) or to the DICOM folder. output_image_path (str, optional): The file path to save the normalized output image to any supported SimpleITK format. If None, the image will not be saved.

  • Returns: normalized_image (SimpleITK.Image): The normalized 3D image.

Supported input/output formats

DICOM Series is recognized when there is no file extension

Examples of usage:

Example (input: medical image format, output: medical image format):

from pyAutoRef import autoref

input_image_path = r"C:\Data\Case10_t2.nii.gz"
output_image_path = r"C:\Data\Case10_t2_normalized.nii.gz"

autoref(input_image_path, output_image_path)

Example (input: medical image format, output: DICOM Series):

from pyAutoRef import autoref

input_image_path = r"C:\Data\Case10_t2.nii.gz"
output_image_path = r"C:\Data\Case10_t2_normalized"

autoref(input_image_path, output_image_path)

Example (input: DICOM Series, output: medical image format):

from pyAutoRef import autoref

input_image_path = r"C:\Data\Case10_t2"
output_image_path = r"C:\Data\Case10_t2_normalized.nii.gz"

autoref(input_image_path, output_image_path)

Example (input: DICOM Series, output: DICOM Series):

from pyAutoRef import autoref

input_image_path = r"C:\Data\Case10_t2"
output_image_path = r"C:\Data\Case10_t2_normalized"

autoref(input_image_path, output_image_path)

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

pyautoref-2.0.0.tar.gz (37.8 MB view details)

Uploaded Source

Built Distribution

pyAutoRef-2.0.0-py3-none-any.whl (37.8 MB view details)

Uploaded Python 3

File details

Details for the file pyautoref-2.0.0.tar.gz.

File metadata

  • Download URL: pyautoref-2.0.0.tar.gz
  • Upload date:
  • Size: 37.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for pyautoref-2.0.0.tar.gz
Algorithm Hash digest
SHA256 305f2d5c2149978a5cca024315c9779aa61882cbb070e81fd41a8899eb3ffca9
MD5 2b8e2d764fffcefd0337280ce196b373
BLAKE2b-256 1d029b2988a1c2595220cb25f9970aff4730b586a3187d7bdaa90b855c45db61

See more details on using hashes here.

Provenance

File details

Details for the file pyAutoRef-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyAutoRef-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 37.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for pyAutoRef-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03fd0f4a3f68f6c7c5c45d6996d7447d8d9ef3aab81fca7caa59f4ffa3c3e9e4
MD5 4ad5b9d205b538c2628a8b7afa66a823
BLAKE2b-256 babaf72679256b49918bbdef4e8638a070c5f8f30bdf5ea2d8c66cb4eab5d81e

See more details on using hashes here.

Provenance

Supported by

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