Skip to content

Commit c215ea5

Browse files
committed
docs(readDICOMTags): Add docs on dicom tag reading
1 parent 82f5b00 commit c215ea5

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

doc/content/api/browser_io.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,19 @@ If the files are known to be from a single, sorted series, the last argument can
6969

7070
The used `webWorkerPool` is returned to enable resource cleanup by calling `.terminateWorkers()`.
7171

72+
## readDICOMTags(webWorker, file, tags=[]) -> { tags, webWorker }
73+
74+
Read tags from a DICOM [File](https://developer.mozilla.org/en-US/docs/Web/API/File).
75+
76+
Tags should be of the form `"GGGG|EEEE"`, where `GGGG` is the group ID in hex and `EEEE` is the element ID in hex. As an example, "0010|0010" is the PatientID.
77+
Hexadecimal strings are treated case-insensitively.
78+
A web worker object can be optionally provided to re-use a previously created web worker.
79+
Otherwise, leave this null.
80+
81+
Returns:
82+
- tags: a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) containing the mapping from tag to tag value.
83+
- webWorker: a webworker that can be re-used.
84+
7285
## writeImageArrayBuffer(webWorker, useCompression, image, fileName, mimeType) -> { webWorker, [arrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) }
7386

7487
Write an image to a an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer).

doc/content/api/node_io.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ If the files are known to be from a single, sorted series, the last argument can
4848

4949
Similar to `readImageLocalDICOMFileSeries`, but returns the image directly instead of a promise.
5050

51+
## readDICOMTagsLocalFile(file, tags=[]) -> Promise<Map>
52+
53+
Read tags from a DICOM [File](https://developer.mozilla.org/en-US/docs/Web/API/File).
54+
55+
Tags should be of the form `"GGGG|EEEE"`, where `GGGG` is the group ID in hex and `EEEE` is the element ID in hex. As an example, "0010|0010" is the PatientID.
56+
Hexadecimal strings are treated case-insensitively.
57+
58+
Returns a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) containing the mapping from tag to tag value.
59+
60+
## readDICOMTagsLocalFileSync(file, tags=[]) -> Map
61+
62+
Similar to `readDICOMTagsLocalFile`, but returns the tag Map directly instead of a promise.
63+
5164
## writeImageLocalFile(useCompression, image, filePath) -> null
5265

5366
Write an image to a file on the local filesystem with Node.js.

0 commit comments

Comments
 (0)