feat(tools): add veterinary (quadruped) orientation label support#2783
feat(tools): add veterinary (quadruped) orientation label support#2783volkan-interpacs wants to merge 2 commits into
Conversation
📝 WalkthroughWalkthroughThis PR adds configurable orientation label sets, updates orientation string generation and inversion to use them, re-exports the new labels, and adds Jest coverage for biped and quadruped cases. ChangesOrientation label configurability
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
sedghi
left a comment
There was a problem hiding this comment.
i'm not a veterinary expert, gpt flagged this please check
[P2] Avoid a generic quadruped label preset — /Users/alireza/open-source/clean/cornerstone3D/packages/tools/src/
utilities/orientation/orientationLabels.ts:57-64
When AnatomicalOrientationType is QUADRUPED, DICOM does not map every study to D/V and CR/CD: head images use rostral/
caudal for +Z/-Z and limb images use proximal/distal (and proximal limbs use cranial/caudal on another axis). This
exported preset is advertised for veterinary QUADRUPED images in general, so callers will produce non-DICOM orientation
strings such as CR instead of R/PR for common head or limb studies; the API needs body-region-specific presets or must
not present this as the general quadruped mapping.
|
Valid point agreed. The quadruped designators are body-region-specific (cranial/caudal for the trunk, rostral/caudal for the head, proximal/distal for limbs), per the designator list in PS3.3 C.7.6.1.1.1. I split the preset into trunk + head and documented limbs. PR updated. |
Context
The orientation utilities (
getOrientationStringLPS,invertOrientationStringLPS) only support human (biped) anatomical designators (L/R, A/P, H/F). Veterinary imaging needs different designators per DICOM PS3.3 C.7.6.1.1.1 (Patient Orientation): whenAnatomicalOrientationType(0010,2210) isQUADRUPED, dorsal/ventral and cranial/caudal labels are used instead.Quadruped designators are body-region-specific (not a single mapping): the trunk/neck/tail use cranial/caudal on the long axis, the head uses rostral/caudal, and limbs use proximal/distal (positioning-dependent).
Changes & Results
packages/tools/src/utilities/orientation/orientationLabels.ts:OrientationLabelstype (designator per patient axis)BIPED_ORIENTATION_LABELS(human, the existing default)QUADRUPED_TRUNK_ORIENTATION_LABELS(LE/RT, D/V, CR/CD, the mapping in the standard's worked abdomen example "LEV\CD")QUADRUPED_HEAD_ORIENTATION_LABELS(LE/RT, D/V, R/CD, rostral for the head)getOrientationStringLPSandinvertOrientationStringLPSaccept an optionallabelsargument (defaults to BIPED, fully backward compatible). The LPS coordinate math is unchanged for any species/region.Testing
Checklist
PR
Code
Public Documentation Updates
Tested Environment