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. (This model is trained using the same data and bounding boxes used to train ACF in the original/MATLAB code).
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.
- All the medical images formats supported by SimpleITK.
- [SimpleITK.Image] (https://simpleitk.org/SimpleITK-Notebooks/01_Image_Basics.html).
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyAutoRef-1.0.2.tar.gz
.
File metadata
- Download URL: pyAutoRef-1.0.2.tar.gz
- Upload date:
- Size: 37.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c419dcb9ee65a4296819b57d6c8cfda7ca59aa1db255f669b0678eb6f81c208 |
|
MD5 | 87bc189e024c531d6f9927782128ec7c |
|
BLAKE2b-256 | 9377c332fd0a1c8dde55d712fe938b6f8720dc787b6f3bca923158c93d325e70 |
Provenance
File details
Details for the file pyAutoRef-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: pyAutoRef-1.0.2-py3-none-any.whl
- Upload date:
- Size: 37.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bab0a35266488ce9f9da60614d34a08f842daeed94a2e828dc306a3a34d5ad5 |
|
MD5 | 949eeeaf2bdadccc9187ebdea3c4db57 |
|
BLAKE2b-256 | 82d3ac653366ec6306f00286a71a9b331861c12d7c71dd8609e09d38e981eba5 |