Build/Test Status | Code Status | Documentation |
---|---|---|
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 radiolgoy 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
pip install MISAToolkit
- 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
- Visualiation of multi-partitions
- Intra-tumoral heterogeneity assessment by anlyzing intra-tumor and surronding microenviourment regions
- Tumor delineation contour perturbation
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
Some local directories are set before processing, including main workding 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')
# make local paths
makedirs(sv_path)
makedirs(csv_path)
makedirs(concat_path)
MISAToolkit provides a functionality to automatically generate multiple regions of interest (ROI) surrounding tumor, whcih 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
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, mode, kernel)
MISAToolkit uses radiomic feature as the default quantiative imaging feature. In this step, MISA 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)
MISAToolkit provides a function to cluster the small pre-segmented regions by analyzing the imaging features, which can gether 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)
MISAToolkit package is freely available to browse, download, and use for scientific and educational purposes as outlined in the Creative Commons Attribution 3.0 Unported License.
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.
- 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
We are happy to help you with any questions. Please contact Zhenwei Shi. Email: [email protected]
We welcome contributions to MISAToolkit.