Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Integrated tumor and microenvironment subtyping refines the colorectal cancer classification system with prognostic and therapeutic implications

This repository contains the official implementation of CT4CMSPlus, a deep learning framework for predicting CMSPlus molecular sutypes of colorectal cancer from preoperative CT scans.

Installation


  • Python 3.8

  • PyTorch 2.4.1, torchvision 0.19.1

  • CUDA 11.3

  • For common packages, simply run:

    pip install -r requirements.txt

    If additional dependencies are missing, please install them manually.

Data Preprocessing


All preprocessing scripts are located in the preprocess_data folder.

1. Colon CT Preprocessing

This script preprocesses colon CT scans by performing:

  • Spatial alignment validation between CT and segmentation masks.
  • Anisotropic resampling to 1.0 × 1.0 × 3.0 mm spacing.
  • Hounsfield Unit (HU) windowing normalization with WL = 35, WW = 300.
python preprocess_colon_ct.py
2. Radiomics Feature Extraction

This unified script performs two major operations:

  • Radiomic Feature Extraction

  • Significant Radiomics Features Selection

python pyradiomics/extract_and_select_radiomics_features.py
3. Dataset Configuration

Datasets should be defined in structured JSON format for model training and inference.

  • Example — training_dataset.json
{
  "fold0": {
    "training": {
      "images/image1.nii.gz": {
        "label": 0,
        "roi": "labels/image1_roi.nii.gz"
      },
      "images/image2.nii.gz": {
        "label": 1,
        "roi": "labels/image2_roi.nii.gz"
      }
    },
    "validation": {
      "images/image3.nii.gz": {
        "label": 0,
        "roi": "labels/image3_roi.nii.gz"
      },
      "images/image4.nii.gz": {
        "label": 1,
        "roi": "labels/image4_roi.nii.gz"
      }
    }
  },
  "fold1": { "...": "..." }
}
  • Example — inference_dataset.json
{
  "training": null,
  "validation": {
    "images/image1.nii.gz": {
      "label": "CMS4",
      "roi": "labels/image1_roi.nii.gz"
    },
    "images/image2.nii.gz": {
      "label": "CMS4",
      "roi": "labels/image2_roi.nii.gz"
    }
    ...
  }
}

CT4CMSPlus Model


All inference scripts are located in the train_infer_code folder.

Inference
1. CMS Classification (CT4CMS)

Use CT4CMS to first predict CMS1–CMS4 molecular subtypes from preoperative CT scans:

Reference: [arXiv: Preprint link]

2. Fine Subclassification (CT4CMSPlus)

Then, use CT4CMSPlus to further stratify CMS4 cases into CMS4-TME(+) and CMS4-TME(-) subtypes.

Before running inference, prepare inference_dataset.json.

python inference.py --data_path ./preprocessed/1_1_3  \
                    --label_path ./path/inference_dataset.json \
                    --radiomics_path ./path/selected_radiomics_features.csv \
                    --pretrained ./pretrained_weights/model.pth \
                    --optimal_threshold 0.5

Acknowledgements


We thank the developers of:

  • [CT4CMS] for CMS classification
  • Med3D (MedicalNet) for 3D-ResNet pretrained models used for transfer learning

License


This project is licensed for academic research use only.

Commercial or clinical usage is prohibited without explicit permission.

About

This repository contains the official implementation of **CT4CMSPlus**, a deep learning framework for predicting CMSPlus molecular sutypes of colorectal cancer from preoperative CT scans.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages