-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interpret ID and window/level metadata
- Loading branch information
Showing
8 changed files
with
78 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,35 @@ | ||
interface Tag { | ||
name: string; | ||
tag: string; | ||
} | ||
export const Tags = { | ||
SOPInstanceUID: '0008|0018', | ||
PatientName: '0010|0010', | ||
PatientID: '0010|0020', | ||
PatientBirthDate: '0010|0030', | ||
PatientSex: '0010|0040', | ||
StudyInstanceUID: '0020|000d', | ||
StudyDate: '0008|0020', | ||
StudyTime: '0008|0030', | ||
StudyID: '0020|0010', | ||
AccessionNumber: '0008|0050', | ||
StudyDescription: '0008|1030', | ||
Modality: '0008|0060', | ||
SeriesInstanceUID: '0020|000e', | ||
SeriesNumber: '0020|0011', | ||
SeriesDescription: '0008|103e', | ||
WindowLevel: '0028|1050', | ||
WindowWidth: '0028|1051', | ||
Rows: '0028|0010', | ||
Columns: '0028|0011', | ||
BitsAllocated: '0028|0100', | ||
BitsStored: '0028|0101', | ||
PixelRepresentation: '0028|0103', | ||
ImagePositionPatient: '0020|0032', | ||
ImageOrientationPatient: '0020|0037', | ||
PixelSpacing: '0028|0030', | ||
SamplesPerPixel: '0028|0002', | ||
RescaleIntercept: '0028|1052', | ||
RescaleSlope: '0028|1053', | ||
NumberOfFrames: '0028|0008', | ||
} as const; | ||
|
||
const tags: Tag[] = [ | ||
{ name: 'SOPInstanceUID', tag: '0008|0018' }, | ||
{ name: 'PatientName', tag: '0010|0010' }, | ||
{ name: 'PatientID', tag: '0010|0020' }, | ||
{ name: 'PatientBirthDate', tag: '0010|0030' }, | ||
{ name: 'PatientSex', tag: '0010|0040' }, | ||
{ name: 'StudyInstanceUID', tag: '0020|000d' }, | ||
{ name: 'StudyDate', tag: '0008|0020' }, | ||
{ name: 'StudyTime', tag: '0008|0030' }, | ||
{ name: 'StudyID', tag: '0020|0010' }, | ||
{ name: 'AccessionNumber', tag: '0008|0050' }, | ||
{ name: 'StudyDescription', tag: '0008|1030' }, | ||
{ name: 'Modality', tag: '0008|0060' }, | ||
{ name: 'SeriesInstanceUID', tag: '0020|000e' }, | ||
{ name: 'SeriesNumber', tag: '0020|0011' }, | ||
{ name: 'SeriesDescription', tag: '0008|103e' }, | ||
{ name: 'WindowLevel', tag: '0028|1050' }, | ||
{ name: 'WindowWidth', tag: '0028|1051' }, | ||
{ name: 'Rows', tag: '0028|0010' }, | ||
{ name: 'Columns', tag: '0028|0011' }, | ||
{ name: 'BitsAllocated', tag: '0028|0100' }, | ||
{ name: 'BitsStored', tag: '0028|0101' }, | ||
{ name: 'PixelRepresentation', tag: '0028|0103' }, | ||
{ name: 'ImagePositionPatient', tag: '0020|0032' }, | ||
{ name: 'ImageOrientationPatient', tag: '0020|0037' }, | ||
{ name: 'PixelSpacing', tag: '0028|0030' }, | ||
{ name: 'SamplesPerPixel', tag: '0028|0002' }, | ||
{ name: 'RescaleIntercept', tag: '0028|1052' }, | ||
{ name: 'RescaleSlope', tag: '0028|1053' }, | ||
{ name: 'NumberOfFrames', tag: '0028|0008' }, | ||
]; | ||
|
||
export const TAG_TO_NAME = new Map(tags.map((t) => [t.tag, t.name])); | ||
export const NAME_TO_TAG = new Map(tags.map((t) => [t.name, t.tag])); | ||
export const Tags = Object.fromEntries(tags.map((t) => [t.name, t.tag])); | ||
export type NameToMeta = { | ||
[key in keyof typeof Tags]: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.