dicomParser
dicomParser copied to clipboard
dicomParser.ByteStream not found
Thanks for the report, but it's a little hard to track down what's going on here with so little information. Is there anything else you can provide? Where are you getting this error? How are you trying to access ByteStream? Is this TypeScript? Browser or Node, etc.?
Hello, I am joining this question by providing some additional specifications. I use Typescript and I need to create a ByteStream object in my code, but when I try to create it, I get the error "The property 'ByteStream' does not exist in the type 'typeof import (" dicom-parser ")' ".
import * as DicomParser from 'dicom-parser';
export async function TestRead(byteArray: Uint8Array): Promise<void> {
let byteStream = new DicomParser.ByteStream(DicomParser.littleEndianByteArrayParser, byteArray);
// some code...
}
Seems ByteStream exists in the index.d.ts
but I have a slightly different but related problem:
https://codesandbox.io/s/typescript-forked-ei38tw?file=/src/index.ts
TypeScript complains if you try to construct one since it's exported as an interface instead of a class from index.d.ts
. This works at runtime, so it's a matter of aligning typings.
I think I've solved my problem, and it might solve your code problem as well. I modified the code in this way and was able to create the ByteStream object:
import * as Dicomparser from "dicom-parser";
export async function TestRead(byteArray: Uint8Array): Promise<void> {
const byteStream: Dicomparser.ByteStream = new Dicomparser.ByteStream(
Dicomparser.littleEndianByteArrayParser,
byteArray,
0);
}
:tada: This issue has been resolved in version 1.8.15 :tada:
The release is available on:
Your semantic-release bot :package::rocket: