Skip to content

Improve RTSTRUCT contour slice matching#910

Merged
wahln merged 4 commits into
e0404:devfrom
acsevillam:pr/rtstruct-contour-slice-matching
May 29, 2026
Merged

Improve RTSTRUCT contour slice matching#910
wahln merged 4 commits into
e0404:devfrom
acsevillam:pr/rtstruct-contour-slice-matching

Conversation

@acsevillam
Copy link
Copy Markdown

Bug description

RTSTRUCT contours close to CT slice boundaries can be incorrectly omitted during DICOM import or contour voxelization. The previous sanity check only compared the contour z-position against the minimum and maximum CT slice positions, instead of checking whether the contour plane intersects the physical CT slice slab.

Approach

This PR centralizes RTSTRUCT contour-to-CT slice matching in matRad_findRtssContourSlicesInCt.

The helper matches a contour z-position against the CT z-axis using ct.dicomInfo.SliceThickness, and is used consistently in:

  • matRad_importDicomRtss
  • matRad_convRtssContours2Indices

Contours outside the available CT volume are omitted with a warning. Valid contours near slice boundaries are accepted and voxelized on the matching CT slice.

No new user-facing parameters, external dependencies are introduced.

Validation

  • matRad_runTests('test/dicom/test_rtssContourSliceMatching.m')
  • MISS_HIT metric/style/lint on the changed files

@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 19, 2026

Documentation build overview

📚 matRad | 🛠️ Build #32903901 | 📁 Comparing fe75e9a against latest (c014dc8)

  🔍 Preview build  

36 files changed · + 1 added · ± 35 modified

+ Added

± Modified

@wahln wahln self-assigned this May 29, 2026
Copy link
Copy Markdown
Contributor

@wahln wahln left a comment

Choose a reason for hiding this comment

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

I made some minor revisions to code style, but other than that it looks really good and i will merge as soon as the tests pass.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 78.78788% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.83%. Comparing base (88ad318) to head (97fd4f1).

Files with missing lines Patch % Lines
matRad/dicom/matRad_findRtssContourSlicesInCt.m 77.27% 5 Missing ⚠️
...com/@matRad_DicomImporter/matRad_importDicomRtss.m 66.66% 1 Missing ⚠️
matRad/dicom/matRad_convRtssContours2Indices.m 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #910      +/-   ##
==========================================
+ Coverage   54.79%   54.83%   +0.03%     
==========================================
  Files         320      321       +1     
  Lines       20548    20568      +20     
==========================================
+ Hits        11260    11278      +18     
- Misses       9288     9290       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Copy Markdown

Test Results

    3 files  ± 0      3 suites  ±0   35m 39s ⏱️ + 7m 28s
  362 tests + 5    362 ✅ + 5  0 💤 ±0  0 ❌ ±0 
1 182 runs  +15  1 177 ✅ +15  5 💤 ±0  0 ❌ ±0 

Results for commit 97fd4f1. ± Comparison against base commit 88ad318.

@wahln wahln merged commit 33bf9a5 into e0404:dev May 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants