- Source
Classes
Members
(static) dictionary
DICOM tag dictionary 2022a. Generated using xml standard conversion from https://github.com/ivmartel/dcmStdToJs v0.1.0. Conversion changes:
- (vr) 'See Note' -> 'NONE', 'OB or OW' -> 'ox', 'US or SS' -> 'xs'
- added 'GenericGroupLength' element to each group Local changes:
- tag numbers with 'xx' were replaced with '00', 'xxx' with '001' and 'xxxx' with '0004'
- Source
(static) requiredDicomSegTags
List of DICOM Seg required tags.
- Source
Methods
(static) DefaultTextDecoder()
Default text decoder
- Source
(static) DefaultTextEncoder()
Default text encoder.
- Source
(static) checkTag(rootElement, tagDefinition)
Check that a DICOM tag definition is present in a parsed element.
Name | Type | Description |
---|---|---|
rootElement | object | The root dicom element. |
tagDefinition | object | The tag definition as {name, tag, type, enum}. |
- Source
(static) checkTags(tags, requiredTags, withLog) → {boolean}
Check a list of input tags against a required list.
Name | Type | Description |
---|---|---|
tags | object | The tags to check. |
requiredTags | Array | Array of tag names. |
withLog | boolean | Flag to log errors or not. |
True if all required tags are present in the input.
- Type:
- boolean
(static) checkUnknownVR(element)
Fix for broken DICOM elements: Replace "UN" with correct VR if the element exists in dictionary
Name | Type | Description |
---|---|---|
element | object | The DICOM element. |
- Source
(static) cleanString(inputStr) → {string}
Clean string: trim and remove ending.
Name | Type | Description |
---|---|---|
inputStr | string | The string to clean. |
- Source
The cleaned string.
- Type:
- string
(static) equalPosPat(pos1, pos2) → {boolean}
Check two position patients for equality.
Name | Type | Description |
---|---|---|
pos1 | * | The first position patient. |
pos2 | * | The second position patient. |
- Source
True is equal.
- Type:
- boolean
(static) flattenArrayOfTypedArrays(initialArray) → {object}
Helper method to flatten an array of typed arrays to 2D typed array
Name | Type | Description |
---|---|---|
initialArray | Array | array of typed arrays |
- Source
a typed array containing all values
- Type:
- object
(static) flipArrayEndianness(array)
Flip an array's endianness. Inspired from DataStream.js.
Name | Type | Description |
---|---|---|
array | object | The array to flip (modified). |
- Source
(static) generatePixelDataFromJSONTags(tags, pixGeneratorName, sliceNumber, images, numberOfSlices) → {object}
Get the DICOM pixel data from a DICOM tags object.
Name | Type | Description |
---|---|---|
tags | object | The DICOM tags object. |
pixGeneratorName | string | The name of a pixel generator. |
sliceNumber | number | The slice number. |
images | Array | The images to pass to the generator. |
numberOfSlices | number | The result number of slices. |
The DICOM pixel data element.
- Type:
- object
(static) getBpeForVrType(vrType) → {number}
Get the number of bytes per element for a given VR type.
Name | Type | Description |
---|---|---|
vrType | string | The VR type as defined in the dictionary. |
- Source
The bytes per element.
- Type:
- number
(static) getCode(element) → {object}
Get a code object from a dicom element.
Name | Type | Description |
---|---|---|
element | object | The dicom element. |
- Source
A code object.
- Type:
- object
(static) getComparePosPat(orientation) → {function}
Get a position patient compare function accroding to an input orientation.
Name | Type | Description |
---|---|---|
orientation | dwv. | The orientation matrix. |
- Source
The position compare function.
- Type:
- function
(static) getDataElementPrefixByteSize(vr, isImplicit) → {number}
Get the number of bytes occupied by a data element prefix, i.e. without its value.
Name | Type | Description |
---|---|---|
vr | string | The Value Representation of the element. |
isImplicit | boolean | Does the data use implicit VR? |
- Source
The size of the element prefix. WARNING: this is valid for tags with a VR, if not sure use the 'isTagWithVR' function first. Reference:
| Tag | VR | VL | Value | | 4 | 2 | 2 | X | -> regular explicit: 8 + X | 4 | 2+2 | 4 | X | -> 32bit VL: 12 + X
| Tag | VL | Value | | 4 | 4 | X | -> implicit (32bit VL): 8 + X
| Tag | Len | Value | | 4 | 4 | X | -> item: 8 + X
- Type:
- number
(static) getDefaultDicomSegJson() → {object}
Get the default DICOM seg tags as an object.
- Source
The default tags.
- Type:
- object
(static) getDicomElement(tagName) → {object}
Get a DICOM element from its tag name (value set separatly).
Name | Type | Description |
---|---|---|
tagName | string | The string tag name. |
- Source
The DICOM element.
- Type:
- object
(static) getDimensionOrganization(rootElement) → {object}
Check the dimension organization from a dicom element.
Name | Type | Description |
---|---|---|
rootElement | object | The root dicom element. |
- Source
The dimension organizations and indices.
- Type:
- object
(static) getDwvUIDPrefix() → {string}
Get the dwv UID prefix. Issued by Medical Connections Ltd (www.medicalconnections.co.uk) on 25/10/2017.
- Source
The dwv UID prefix.
- Type:
- string
(static) getElementsFromJSONTags(jsonTags) → {object}
Get the DICOM elements from a DICOM json tags object. The json is a simplified version of the oficial DICOM json with tag names instead of keys and direct values (no value property) for simple tags.
Name | Type | Description |
---|---|---|
jsonTags | object | The DICOM json tags object. |
The DICOM elements.
- Type:
- object
(static) getFileListFromDicomDir(data) → {Array|undefined}
Get the file list from a DICOMDIR
Name | Type | Description |
---|---|---|
data | object | The buffer data of the DICOMDIR |
The file list as an array ordered by STUDY > SERIES > IMAGES.
- Type:
- Array |
undefined
(static) getFileMetaInformationGroupLengthTag() → {object}
Get the FileMetaInformationGroupLength Tag.
- Source
The tag.
- Type:
- object
(static) getImageDataData(image) → {object}
Extract the image data from an image.
Name | Type | Description |
---|---|---|
image | Image | The image to get the data from. |
The image data buffer.
- Type:
- object
(static) getItemDelimitationItemTag() → {dwv.dicom.Tag}
Get the ItemDelimitationItem Tag.
- Source
The tag.
- Type:
- dwv.
dicom. Tag
(static) getItemTag() → {dwv.dicom.Tag}
Get the Item Tag.
- Source
The tag.
- Type:
- dwv.
dicom. Tag
(static) getOrientationName(orientation) → {string}
Get the name of an image orientation patient.
Name | Type | Description |
---|---|---|
orientation | Array | The image orientation patient. |
- Source
The orientation name: axial, coronal or sagittal.
- Type:
- string
(static) getPixelDataTag() → {dwv.dicom.Tag}
Get the PixelData Tag.
- Source
The tag.
- Type:
- dwv.
dicom. Tag
(static) getReverseOrientation(ori) → {string}
Get patient orientation label in the reverse direction.
Name | Type | Description |
---|---|---|
ori | string | Patient Orientation value. |
- Source
Reverse Orientation Label.
- Type:
- string
(static) getSegment(element) → {object}
Get a segment object from a dicom element.
Name | Type | Description |
---|---|---|
element | object | The dicom element. |
- Source
A segment object.
- Type:
- object
(static) getSegmentFrameInfo(groupItem) → {object}
Get a frame information object from a dicom element.
Name | Type | Description |
---|---|---|
groupItem | object | The dicom element. |
- Source
A frame information object.
- Type:
- object
(static) getSequenceDelimitationItemTag() → {dwv.dicom.Tag}
Get the SequenceDelimitationItem Tag.
- Source
The tag.
- Type:
- dwv.
dicom. Tag
(static) getSpacingFromMeasure(measure) → {dwv.image.Spacing}
Get a spacing object from a dicom measure element.
Name | Type | Description |
---|---|---|
measure | object | The dicom element. |
- Source
A spacing object.
- Type:
- dwv.
image. Spacing
(static) getSyntaxDecompressionName(syntax) → {string}
Tell if a given syntax needs decompression.
Name | Type | Description |
---|---|---|
syntax | string | The transfer syntax to test. |
- Source
The name of the decompression algorithm.
- Type:
- string
(static) getTagFromDictionary(tagName) → {object|null}
Get a tag from the dictionary using a tag string name.
Name | Type | Description |
---|---|---|
tagName | string | The tag string name. |
- Source
The tag object or null if not found.
- Type:
- object |
null
(static) getTagFromKey(key) → {object}
Split a group-element key used to store DICOM elements.
Name | Type | Description |
---|---|---|
key | string | The key in form "x00280102" as generated by tag::getKey. |
- Source
The DICOM tag.
- Type:
- object
(static) getTransferSyntaxName(syntax) → {string}
Get the transfer syntax name. Reference: UID Values.
Name | Type | Description |
---|---|---|
syntax | string | The transfer syntax. |
- Source
The name of the transfer syntax.
- Type:
- string
(static) getTransferSyntaxUIDTag() → {object}
Get the TransferSyntaxUID Tag.
- Source
The tag.
- Type:
- object
(static) getTypedArray(bitsAllocated, pixelRepresentation, size) → {Array}
Get the appropriate TypedArray in function of arguments.
Name | Type | Description |
---|---|---|
bitsAllocated | number | The number of bites used to store the data: [8, 16, 32]. |
pixelRepresentation | number | The pixel representation, 0:unsigned;1:signed. |
size | dwv. | The size of the new array. |
- Source
The good typed array.
- Type:
- Array
(static) getUID(tagName) → {string}
Get a UID for a DICOM tag. Note: Use https://github.com/uuidjs/uuid?
Name | Type | Description |
---|---|---|
tagName | string | The input tag. |
- Source
The corresponding UID.
- Type:
- string
(static) getUtfLabel(charSetTerm) → {string}
Get the utfLabel (used by the TextDecoder) from a character set term References:
Name | Type | Description |
---|---|---|
charSetTerm | string | The DICOM character set. |
- Source
The corresponding UTF label.
- Type:
- string
(static) getVrPad(vr) → {boolean}
Get the VR specific padding value.
Name | Type | Description |
---|---|---|
vr | string | The element VR. |
- Source
The value used to pad.
- Type:
- boolean
(static) guessTransferSyntax(firstDataElement) → {object}
Guess the transfer syntax from the first data element. See https://github.com/ivmartel/dwv/issues/188 (Allow to load DICOM with no DICM preamble) for more details.
Name | Type | Description |
---|---|---|
firstDataElement | object | The first data element of the DICOM header. |
- Source
The transfer syntax data element.
- Type:
- object
(static) hasDicomPrefix(buffer) → {boolean}
Check that an input buffer includes the DICOM prefix 'DICM' after the 128 bytes preamble. Ref: DICOM File Meta
Name | Type | Description |
---|---|---|
buffer | ArrayBuffer | The buffer to check. |
- Source
True if the buffer includes the prefix.
- Type:
- boolean
(static) is32bitVLVR(vr) → {boolean}
Does this Value Representation (VR) have a 32bit Value Length (VL). Ref: Data Element explicit.
Name | Type | Description |
---|---|---|
vr | string | The data Value Representation (VR). |
- Source
True if this VR has a 32-bit VL.
- Type:
- boolean
(static) isBigEndianTransferSyntax(syntax) → {boolean}
Tell if a given syntax is a big endian syntax.
Name | Type | Description |
---|---|---|
syntax | string | The transfer syntax to test. |
- Source
True if a big endian syntax.
- Type:
- boolean
(static) isEqualSegment(seg1, seg2) → {boolean}
Check if two segment objects are equal.
Name | Type | Description |
---|---|---|
seg1 | object | The first segment. |
seg2 | object | The second segment. |
- Source
True if both segment are equal.
- Type:
- boolean
(static) isEven(number) → {boolean}
Return true if the input number is even.
Name | Type | Description |
---|---|---|
number | number | The number to check. |
- Source
True is the number is even.
- Type:
- boolean
(static) isFileMetaInformationGroupLengthTag(tag) → {boolean}
Is the input tag the FileMetaInformationGroupLength Tag.
Name | Type | Description |
---|---|---|
tag | dwv. | The tag to test. |
- Source
True if the asked tag.
- Type:
- boolean
(static) isImplicitTransferSyntax(syntax) → {boolean}
Tell if a given syntax is an implicit one (element with no VR).
Name | Type | Description |
---|---|---|
syntax | string | The transfer syntax to test. |
- Source
True if an implicit syntax.
- Type:
- boolean
(static) isItemDelimitationItemTag(tag) → {boolean}
Is the input tag the ItemDelimitationItem Tag.
Name | Type | Description |
---|---|---|
tag | dwv. | The tag to test. |
- Source
True if the asked tag.
- Type:
- boolean
(static) isItemTag(tag) → {boolean}
Is the input tag the Item Tag.
Name | Type | Description |
---|---|---|
tag | dwv. | The tag to test. |
- Source
True if the asked tag.
- Type:
- boolean
(static) isJpeg2000TransferSyntax(syntax) → {boolean}
Tell if a given syntax is a JPEG 2000 one.
Name | Type | Description |
---|---|---|
syntax | string | The transfer syntax to test. |
- Source
True if a jpeg 2000 syntax.
- Type:
- boolean
(static) isJpegBaselineTransferSyntax(syntax) → {boolean}
Tell if a given syntax is a JPEG baseline one.
Name | Type | Description |
---|---|---|
syntax | string | The transfer syntax to test. |
- Source
True if a jpeg baseline syntax.
- Type:
- boolean
(static) isJpegLosslessTransferSyntax(syntax) → {boolean}
Tell if a given syntax is a JPEG Lossless one.
Name | Type | Description |
---|---|---|
syntax | string | The transfer syntax to test. |
- Source
True if a jpeg lossless syntax.
- Type:
- boolean
(static) isJpegRetiredTransferSyntax(syntax) → {boolean}
Tell if a given syntax is a retired JPEG one.
Name | Type | Description |
---|---|---|
syntax | string | The transfer syntax to test. |
- Source
True if a retired jpeg syntax.
- Type:
- boolean
(static) isJpeglsTransferSyntax(syntax) → {boolean}
Tell if a given syntax is a JPEG-LS one.
Name | Type | Description |
---|---|---|
syntax | string | The transfer syntax to test. |
- Source
True if a jpeg-ls syntax.
- Type:
- boolean
(static) isNativeLittleEndian()
Is the Native endianness Little Endian.
- Source
(static) isPixelDataTag(tag) → {boolean}
Is the input tag the PixelData Tag.
Name | Type | Description |
---|---|---|
tag | dwv. | The tag to test. |
- Source
True if the asked tag.
- Type:
- boolean
(static) isReadSupportedTransferSyntax(syntax) → {boolean}
Tell if a given syntax is supported for reading.
Name | Type | Description |
---|---|---|
syntax | string | The transfer syntax to test. |
- Source
True if a supported syntax.
- Type:
- boolean
(static) isRleTransferSyntax(syntax) → {boolean}
Tell if a given syntax is a RLE (Run-length encoding) one.
Name | Type | Description |
---|---|---|
syntax | string | The transfer syntax to test. |
- Source
True if a RLE syntax.
- Type:
- boolean
(static) isSequenceDelimitationItemTag(tag) → {boolean}
Is the input tag the SequenceDelimitationItem Tag.
Name | Type | Description |
---|---|---|
tag | dwv. | The tag to test. |
- Source
True if the asked tag.
- Type:
- boolean
(static) isSimilarSegment(seg1, seg2) → {boolean}
Check if two segment objects are similar: either the number or the displayValue are equal.
Name | Type | Description |
---|---|---|
seg1 | object | The first segment. |
seg2 | object | The second segment. |
- Source
True if both segment are similar.
- Type:
- boolean
(static) isStringVr(vr) → {boolean}
Is the input VR a string VR.
Name | Type | Description |
---|---|---|
vr | string | The element VR. |
- Source
True if the VR is a string one.
- Type:
- boolean
(static) isTypedArrayVr(vr) → {boolean}
Is the input VR a VR that stores data in a typed array. TODO: include ox and xs?
Name | Type | Description |
---|---|---|
vr | string | The element VR. |
- Source
True if the VR is a typed array one.
- Type:
- boolean
(static) isVrToPad(vr) → {boolean}
Is the input VR a VR that could need padding. see http://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html
Name | Type | Description |
---|---|---|
vr | string | The element VR. |
- Source
True if the VR needs padding.
- Type:
- boolean
(static) padOBValue(value) → {Array|Uint8Array}
Pad an input OB value.
Name | Type | Description |
---|---|---|
value | Array | | The input value. |
- Source
The padded input.
- Type:
- Array |
Uint8Array
(static) tagCompareFunction(a, b) → {number}
Tag compare function.
Name | Type | Description |
---|---|---|
a | dwv. | The first tag. |
b | dwv. | The second tag. |
- Source
The result of the tag comparison, positive for b before a, negative for a before b and zero to keep same order.
- Type:
- number
(static) uint8ArrayPush(arr, value) → {Uint8Array}
Push a value at the end of an input Uint8Array.
Name | Type | Description |
---|---|---|
arr | Uint8Array | The input array. |
value | number | The value to push. |
- Source
The new array.
- Type:
- Uint8Array