Skip to content
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

@itk-wasm/dicom readTags Typescript types are funny #896

Closed
PaulHax opened this issue Aug 15, 2023 · 2 comments · Fixed by #898
Closed

@itk-wasm/dicom readTags Typescript types are funny #896

PaulHax opened this issue Aug 15, 2023 · 2 comments · Fixed by #898

Comments

@PaulHax
Copy link
Collaborator

PaulHax commented Aug 15, 2023

Some bread crumbs for bleeding edge @itk-wasm/dicom readTags users.

ReadDicomTagsOptions Typescript type is a bit sparse at the moment. Its shape should be

interface ReadDicomTagsOptions {
    /** A JSON object with a "tags" array of the tags to read. If not provided, all tags are read. Example tag: "0008|103e". */
    tagsToRead?: { tags: Array<string> }
}

Usage

const result = await readDicomTags(
  this.webWorker,
  sanitizeFile(file),
  { tagsToRead: { tags: ["0008|103e"] } }
);

// @ts-expect-error @itk-wasm/dicom autogenerated types are WIP
const tagValues = new Map(result.tags);
@thewtex
Copy link
Member

thewtex commented Aug 15, 2023

Can { tags: Array<string> } please replace Object here?

https://github.com/InsightSoftwareConsortium/itk-wasm/blob/06a3ee26e499e59b426b2abee7db5b76f6b6baed/packages/dicom/typescript/src/read-dicom-tags-options.ts

And remove the comment from the top line?

github-actions bot pushed a commit that referenced this issue Aug 16, 2023
# [1.0.0-b.127](itk-wasm-v1.0.0-b.126...itk-wasm-v1.0.0-b.127) (2023-08-16)

### Bug Fixes

* **read-dicom-tags:** tweek typescript options and return types ([4b96022](4b96022)), closes [#896](#896)
@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0-b.127 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants