A toolkit for medical image subregion analysis
Project description
Medical Image Subregion Analysis Toolkit (MISAToolkit)
Build/Test Status | Code Status | Documentation |
---|---|---|
Welcome to Medical Image Subregion Analysis Toolkit (MISAToolkit) package.
MISAToolkit is a Python package, which aims for tumor subregion and surrounding microenvironment analysis in cancer domain by medical imaging data, such as CT, PET, MRI and US. Note that, MISAToolkit is not only developed for 3D medical data, but also for 2D medical data (e.g., US or single 2D slice).
MISAToolkit is designed and developed by Zhenwei Shi, Zhihe Zhao and other AI/CS scientists from Media Lab. Also, the work is supported and guided by well-known radiologists MD Zaiyi Liu and MD Changhong Liang from the radiology department of Guangdong Provincial People's Hospital.
The workflow of MISAToolkit includes five major functionalities:
- Data pre-processing
- Subregion pre-segmentation
- Clustering in population-level
- Intra-tumoral heterogeneity assessment
- Tumor delineation contour perturbation
Installation
pip install MISAToolkit
Features
- Medical image data pre-processing, including data load, crop, normalization and so on.
- Automatic generation of multiple regions of interest surrounding tumor, such as peritumor and tumor ring
- Subregion pre-segmentation by image properties
- Quantitative imaging feature (e.g., Radiomics) extraction
- Unsupervised clustering algorithms for untimate medical image subregion partition
- Visualisation of multi-partitions
- Intra-tumoral heterogeneity assessment by analyzing intra-tumor and surrounding microenvironment regions
- Tumor delineation contour perturbation
Tutorial
1. Package Loading
import numpy as np
import matplotlib.pyplot as plt
import os
from MISAToolkit.function import makedirs, extract_main, feature_extract_main, cluster_main, cluster_main_predict
2. Parameter Setting
Some local directories are set before processing, including main working directory, image and mask directory, output directory, and also parameter setting directory for quantitative imaging feature extraction. Note that, MISAToolkit uses an open-source software PyRadiomics to extract radiomic features as default, while the clients are allowed to use any other kinds of features. For radiomics extraction, the clients can download the parameter setting file (.ymal) for simulation from MISAToolkit.
# set local paths
dataset_path = 'dataset'
image_path = dataset_path+'/image'
mask_path = dataset_path+'/mask'
out_path = 'subregion_SLIC_output/SuperVoxel'
yaml_path = 'radiomics_features.yaml'
sv_path = os.path.join(out_path,'supervoxel')
csv_path = os.path.join(out_path,'csv')
concat_path = os.path.join(out_path, 'concat_mask')
preseg_path = os.path.join(out_path, 'preseg_mask')
# make local paths
makedirs(sv_path)
makedirs(csv_path)
makedirs(concat_path)
makedirs(preseg_path)
MISAToolkit provides a functionality to automatically generate multiple regions of interest (ROI) surrounding tumor, which are able to describe tumor microenvironment, such as peritumor and tumor ring. The clients can change the size of the peritumor or tumor ring area by modifying the kernel_size parameter, and select the subregion processing mode: 'initial (default as original tumor)', 'peritumor', 'tumor ring'.
mode = 'peritumor' # 'initial','peritumor','tumor_ring'
kernel_size = 3
3. Pre-segmentation of subregions
MISAToolkit follows a two-step subregion segmentation strategy, that is, pre-segmentation and fine subregion partition. In the pre-segmentation step, it splits the whole ROI in pieces by taking into account image properties itself, of which the number depends on the surface/volume of the ROI. To preserve enough information for feature extraction later, MISAToolkit suggests not to split the individual pre-segments too small. Some examples with pre-segmented subregion maps are shown as follows.
extract_main(image_path, mask_path, sv_path, out_path, preseg_path, mode, kernel_size)
4. Quantitative imaging feature extraction
MISAToolkit uses radiomics feature as the default quantative imaging feature. In this step, MISAToolkit is able to extract radiomics from the small regions aquired above. Also, the clients are allowed to use other kinds of features, such as deep learning and handcraft features.
feature_extract_main(sv_path, csv_path,yaml_path)
5. Generation of subregion partition map
MISAToolkit provides a function to cluster the small pre-segmented regions by analyzing the imaging features, which can gather the small regions with similar properties. Some examples with final subregion partition maps are shown as follows.
cluster_main(image_path, csv_path, sv_path, concat_path, out_path)
Disclaimer
MISAToolkit is still under development. Although we have tested and evaluated the workflow under many different situations, it may have errors and bugs unfortunately. Please use it cautiously. If you find any, please contact us and we would fix them ASAP.
Main Developers
- Dr. Zhenwei Shi 1, 2
- MSc. Zhihe Zhao 2, 3
- MSc. Zihan Cao 2, 4
- MD. Xiaomei Huang 2, 5
- Dr. Chu Han 1, 2
- MD. Changhong Liang 1, 2
- MD. Zaiyi Liu 1, 2
1 Department of Radiology, Guangdong Provincial People's Hospital (Guangdong Academy of Medical Sciences), Southern Medical University, China
2 Guangdong Provincial Key Laboratory of Artificial Intelligence in Medical Image Analysis and Application, China
3 School of Medicine, South China University of Technology, China
4 Institute of Computing Science and Technology, Guangzhou University, China
5 Department of Medical Imaging, Nanfang Hospital, Southern Medical University, China
Contact
We are happy to help you with any questions. Please contact Zhenwei Shi. Email: shizhenwei@gdph.org.cn
We welcome contributions to MISAToolkit.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file MISAToolkit-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: MISAToolkit-1.0.4-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d7fb9c9ab4baba02b8fad07f1c771ca86c4622940c1e746e782feb75223ef8a |
|
MD5 | a43d7a95aa845dd08a330408191e499d |
|
BLAKE2b-256 | 6ba2e317dc3044070a88ef15bbd77766ab75ba51419452dd042cf64d5bd3e358 |