Skip to content

Read dicom tags #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions doc/content/api/browser_io.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ If the files are known to be from a single, sorted series, the last argument can

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

## readDICOMTags(webWorker, file, tags=[]) -> { tags, webWorker }

Read tags from a DICOM [File](https://developer.mozilla.org/en-US/docs/Web/API/File).

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.
Hexadecimal strings are treated case-insensitively.
A web worker object can be optionally provided to re-use a previously created web worker.
Otherwise, leave this null.

Returns:
- tags: a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) containing the mapping from tag to tag value.
- webWorker: a webworker that can be re-used.

## writeImageArrayBuffer(webWorker, useCompression, image, fileName, mimeType) -> { webWorker, [arrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) }

Write an image to a an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer).
Expand Down
13 changes: 13 additions & 0 deletions doc/content/api/node_io.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ If the files are known to be from a single, sorted series, the last argument can

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

## readDICOMTagsLocalFile(file, tags=[]) -> Promise<Map>

Read tags from a DICOM [File](https://developer.mozilla.org/en-US/docs/Web/API/File).

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.
Hexadecimal strings are treated case-insensitively.

Returns a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) containing the mapping from tag to tag value.

## readDICOMTagsLocalFileSync(file, tags=[]) -> Map

Similar to `readDICOMTagsLocalFile`, but returns the tag Map directly instead of a promise.

## writeImageLocalFile(useCompression, image, filePath) -> null

Write an image to a file on the local filesystem with Node.js.
Expand Down
Loading