Skip to content

Read ultrasound spacing from SequenceOfUltrasoundRegions#863

Open
PaulHax wants to merge 5 commits intoKitware:mainfrom
PaulHax:ultrasound-spacing
Open

Read ultrasound spacing from SequenceOfUltrasoundRegions#863
PaulHax wants to merge 5 commits intoKitware:mainfrom
PaulHax:ultrasound-spacing

Conversation

@PaulHax
Copy link
Copy Markdown
Collaborator

@PaulHax PaulHax commented Apr 16, 2026

Applies PhysicalDeltaX/Y (cm) from the first US region to the VTK image spacing when modality is US, so rulers show physical mm instead of pixel counts.

Ultrasound DICOM files:

https://raw.githubusercontent.com/pydicom/pydicom/main/src/pydicom/data/test_files/examples_ybr_color.dcm

https://raw.githubusercontent.com/pydicom/pydicom-data/master/data_store/data/color3d_jpeg_baseline.dcm

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 16, 2026

Deploy Preview for volview-dev ready!

Name Link
🔨 Latest commit caa5339
🔍 Latest deploy log https://app.netlify.com/projects/volview-dev/deploys/69f8c6f320946a00081f32ba
😎 Deploy Preview https://deploy-preview-863--volview-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@PaulHax PaulHax force-pushed the ultrasound-spacing branch 2 times, most recently from 7893a24 to b505b0e Compare April 21, 2026 20:53
@PaulHax PaulHax force-pushed the ultrasound-spacing branch from b505b0e to fed8bf2 Compare April 21, 2026 21:31
PaulHax added 3 commits May 4, 2026 11:37
Per DICOM PS3.3 C.8.5.5.1.15, code 3 (cm) is the only spatial spacing
unit defined for PhysicalUnitsXDirection / YDirection — codes 0, 1, 2,
4–10 cover none / percent / dB / seconds / hertz / dB/sec / cm/sec /
cm² / cm²/sec / degrees. Replace the strict cm equality check with a
unitToMm helper that returns 10 for cm and null for everything else,
applied per axis. Functionally equivalent to the previous strict check,
but isolates the unit-to-spacing mapping in one tested place and adds a
clear extension point if a vendor exception ever needs to be honoured.
VTK image data has a single global spacing, so a multi-region ultrasound
(e.g. dual-pane B-mode + Doppler) cannot be fully represented. Surface
the total region count alongside the first region's spacing and warn in
the console when more than one region exists, so the partial-coverage
limitation is visible rather than silent.
Stop encoding UltrasoundRegions as a JSON string under a magic key on
the DICOM tag pair array and decoding it back. Expose it as a typed
property on MetaLoader, surface it on Chunk, and read it directly in
DicomChunkImage. The tag pair array now only contains DICOM tag/value
pairs.
@PaulHax PaulHax requested a review from arhowe00 May 4, 2026 16:21
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.

1 participant