Skip to content

DeepCAC2 submission - #111

Merged
LennyN95 merged 20 commits into
mainfrom
deepcac2_submission
Nov 21, 2026
Merged

LennyN95 merged 20 commits into
mainfrom
deepcac2_submission

Conversation

@LennyN95

@LennyN95 LennyN95 commented Apr 30, 2026 •

Copy link
Copy Markdown
Member

@github-project-automation github-project-automation Bot moved this to Submitted Implementations in MHub Submissions Apr 30, 2026
LennyN95 and others added 16 commits April 30, 2026 05:55
- config used for whole NLST processing (deepcac_dicom_simple.yml)
- update model dirctory aim_deepcac2 -> deepcac2
- update entrypoint cmd to use default workflow
- ensure file name is correct (without trailing url query string ?..)
- use env variables for better readability
nnunet 1.7.x depends on dicom2nifti, and newer dicom2nifti pulled in pydicom 3.x, which breaks mhubio, thedicomsort, and wsidicom (all require pydicom <3). At the same time, scipy allowed numpy 2.x, but pydicom-seg and wsidicom require numpy <2, and compiled libraries (e.g., SimpleITK, scipy) were built against NumPy 1.x, causing runtime errors. The environment became inconsistent because dependencies were not pinned and later installs overrode earlier constraints. Fix by pinning: dicom2nifti<2.6, pydicom==2.4.4, numpy==1.26.4.

ISSUE:
nnunet 1.7.x → dicom2nifti
dicom2nifti 2.6.x → pydicom>=3.0.0
nnunet 1.7.x → numpy

FIX:
dicom2nifti<2.6
- avoids pydicom>=3

pydicom==2.4.4
- satisfies mhubio and stays <3 for thedicomsort/wsidicom

numpy==1.26.4
- satisfies scipy while staying <2 for pydicom-seg/wsidicom
- test case used: NLST, 100002, T0 (1.2.840.113654.2.55.257926562693607663865369179341285235858)
- test files were generated following the documentation ()
- test files are published via Zenodo under https://doi.org/10.5281/zenodo.19921180 and can be downloaded under https://zenodo.org/records/19921180
- parses the input directory for files matching `(\d+).nii.gz`
- the file-name is kept inside the MHub.ai run engine under the key `pid`
- and included in the report as `{"PatientID": "file-name"}`
- replace legacy Agatston scoring and CAC mapping with shared calcium
analysis using a 130 HU threshold, 4-connected regions of at least 1 mm²,
slice-spacing normalization, and unrounded risk classification

- expose aggregate and individual lesion measurements through MHub outputs
and JSON reports; add DICOM SEG and TID 1500 SR exports, configurable 3D
lesion connectivity, and an explicit dcm2niix DICOM workflow

- update model metadata
- remove obsolete processing modules
- use CACS or CAC score instead of AGS or Agatston score
NOTE: model was training on LPS oriented patches; using dcm2niix over plastimatch generates LAS oriented nifti files that need to be consistently oriented into LPS before processing.
@LennyN95
LennyN95 requested a balanced review from Copilot November 21, 2026 07:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

NOTE: these tests are additional local implementation tests, they do not include gpu inference, full pipeline execution, and don't replace the MHub.ai documented test procedure.

@LennyN95 LennyN95 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review approved.

@LennyN95 LennyN95 added REQUEST TEST Attach this label to your PR when your submission is ready to be tested by us. TEST REQUESTED labels Nov 21, 2026
@LennyN95

Copy link
Copy Markdown
Member Author

Static Badge

Test Results
id: 2f5dd8ae-a010-4441-ba9f-ca86bab9ec84
name: MHub Test Report (default)
date: '2026-11-21 13:17:35'
checked_files:
- file: DeepCAC.report.json
  path: /app/data/output_data/DeepCAC.report.json
  checks:
  - checker: DataFileCheck
    notes:
    - label: Value Match
      description: These keys have identical values
      info: '[0].SeriesInstanceUID,[0].PatientID,[0].Scoring Version,[0].Lesion Connectivity,[0].Predicted
        CAC Score,[0].Predicted Risk Group,[0].Calcium Volume (mm3),[0].Segmentation
        Volume (mm3),[0].Number of Lesions,[0].Lesion IDs.[0],[0].Lesion IDs.[1],[0].Lesion
        IDs.[2],[0].Lesion IDs.[3],[0].Lesion IDs.[4],[0].Lesion IDs.[5],[0].Lesion
        IDs.[6],[0].Individual Lesion Volumes (mm3).[0],[0].Individual Lesion Volumes
        (mm3).[1],[0].Individual Lesion Volumes (mm3).[2],[0].Individual Lesion Volumes
        (mm3).[3] (+ 31 more)'
  - checker: SizeCheck
- file: DeepCAC2.seg.dcm
  path: /app/data/output_data/1.2.840.113654.2.55.257926562693607663865369179341285235858/DeepCAC2.seg.dcm
  checks:
  - checker: DicomsegContentCheck
    notes:
    - label: Segment Count
      description: The number of segments identified in the inspected dicomseg file.
      info: 2
- file: DeepCAC.report.json
  path: /app/data/output_data/1.2.840.113654.2.55.257926562693607663865369179341285235858/DeepCAC.report.json
  checks:
  - checker: DataFileCheck
    notes:
    - label: Value Match
      description: These keys have identical values
      info: SeriesInstanceUID,PatientID,Scoring Version,Lesion Connectivity,Predicted
        CAC Score,Predicted Risk Group,Calcium Volume (mm3),Segmentation Volume (mm3),Number
        of Lesions,Lesion IDs.[0],Lesion IDs.[1],Lesion IDs.[2],Lesion IDs.[3],Lesion
        IDs.[4],Lesion IDs.[5],Lesion IDs.[6],Individual Lesion Volumes (mm3).[0],Individual
        Lesion Volumes (mm3).[1],Individual Lesion Volumes (mm3).[2],Individual Lesion
        Volumes (mm3).[3] (+ 31 more)
  - checker: SizeCheck
summary:
  files_missing: 0
  files_extra: 0
  checks:
    DataFileCheck:
      files: 2
    SizeCheck:
      files: 2
    DicomsegContentCheck:
      files: 1
conclusion: true

@LennyN95
LennyN95 merged commit c0a69ca into main Nov 21, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Submitted Implementations to Done in MHub Submissions Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

REQUEST TEST Attach this label to your PR when your submission is ready to be tested by us. TEST REQUESTED

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants