Skip to content

Add multi-timepoint qSPECT workflow and improve GE DICOM quantification - #120

Merged
carluri merged 9 commits into
devfrom
feature/workflows
Aug 27, 2026
Merged

Add multi-timepoint qSPECT workflow and improve GE DICOM quantification#120
carluri merged 9 commits into
devfrom
feature/workflows

Conversation

@plesqui

@plesqui plesqui commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Introduces a new workflows/ section for task-oriented processing notebooks, distinct from the guided tutorials.
  • Adds a configurable multi-timepoint qSPECT workflow that converts reconstructed SPECT counts to quantitative Bq/mL DICOM images.
  • Adds quantitative activity checks and visualization across acquisition time points.
  • Improves GE Pixel Scale handling and DICOM UID generation in DicomModify.make_bqml_suv.

Workflow

The new workflows/qSPECT/counts_to_bqml.ipynb notebook:

  • Recursively discovers reconstructed SPECT DICOM files while excluding existing qSPECT outputs.
  • Supports processing multiple time points from one radiopharmaceutical administration.
  • Validates calibration, patient, administration, timing, and scanner-specific inputs before conversion.
  • Converts each input independently and records converted, skipped, and failed results.
  • Writes _qSPECT.dcm outputs without modifying source files.
  • Summarizes acquisition and injection metadata for review.
  • Integrates Bq/mL voxel values to calculate total activity within the field of view.
  • Compares each FOV measurement against net injected activity physically decayed to its acquisition time, with a 10% tolerance.
  • Back-extrapolates the earliest measurement to injection time using physical decay, without fitting.
  • Plots measured activity, the first-point back-extrapolation, and the decay-corrected injected-activity tolerance boundary.
  • Provides final conversion and quantitative QC checks.

GE quantification

  • Reads GE private tag (0011,103B) Pixel Scale and applies it to stored pixels before quantification.
  • Defaults Pixel Scale to 1.0 when the tag is absent.
  • Supports numeric values stored as either text or raw bytes.
  • Rejects invalid, non-finite, zero, or negative Pixel Scale values.
  • Reports the applied GE Pixel Scale in the conversion summary.
  • Documents the distinction between Pixel Scale and GE projections multiplication, including the need for calibration-matched reconstruction settings.

DICOM robustness

  • Generates valid replacement SOP Instance and Series Instance UIDs.
  • Preserves the source UID root when it fits DICOM/pydicom limits.
  • Falls back to pydicom’s default UID root when the source prefix is too long.
  • Keeps MediaStorageSOPInstanceUID synchronized with the generated SOP Instance UID.

Tests and documentation

  • Adds tests for missing, valid, byte-encoded, and invalid GE Pixel Scale values.
  • Verifies that Pixel Scale is applied to the quantitative mapping.
  • Adds coverage for long source UID prefixes and file-meta synchronization.
  • Documents workflow usage conventions and the available qSPECT workflow in workflows/README.md.

@plesqui
plesqui requested a review from carluri August 27, 2026 18:03
@carluri
carluri merged commit 2736e4e into dev Aug 27, 2026
2 checks passed
@carluri
carluri deleted the feature/workflows branch August 27, 2026 19:57
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