Skip to content

Commit

Permalink
fix(tools): Add support for additional region data types and length v…
Browse files Browse the repository at this point in the history
…ariants (#1736)

* fix: check length of annotation on eraser _deleteNearbyAnnotations

* fix(tools): Add support for additional region data types and length variants

* style(tools): update formating for getCalibratedUnits

and add comment re: Pixel Physical Units and Region Data Types

---------

Co-authored-by: Simon Bertoli <[email protected]>
Co-authored-by: simonbertoli <[email protected]>
  • Loading branch information
3 people authored Jan 7, 2025
1 parent 5ec16c8 commit 397dea0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/tools/src/utilities/getCalibratedUnits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,31 @@ import { Enums, utilities } from '@cornerstonejs/core';
const { CalibrationTypes } = Enums;
const PIXEL_UNITS = 'px';

/**
* DICOM Region Data Types as defined in the DICOM standard
* https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.5.5.html#sect_C.8.5.5.1.2
*/
const SUPPORTED_REGION_DATA_TYPES = [
1, // Tissue
2, // Color Flow
3, // PW Spectral Doppler
4, // CW Spectral Doppler
];

const SUPPORTED_LENGTH_VARIANT = [
'3,3', // x: cm & y:cm
'3,3', // x: cm & y:cm
'4,7', // x: seconds & y : cm/sec
];

const SUPPORTED_PROBE_VARIANT = [
'4,3', // x: seconds & y : cm
'4,3', // x: seconds & y : cm
'4,7', // x: seconds & y : cm/sec
];

/**
* DICOM Pixel Physical Units as defined in the DICOM standard
* https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.5.5.html#sect_C.8.5.5.1.6
*/
const UNIT_MAPPING = {
0: 'px',
1: 'percent',
Expand Down

0 comments on commit 397dea0

Please sign in to comment.