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

Write issue for JPEG2000Loseless images #375

Open
syedkibrahim opened this issue Jan 5, 2024 · 3 comments
Open

Write issue for JPEG2000Loseless images #375

syedkibrahim opened this issue Jan 5, 2024 · 3 comments

Comments

@syedkibrahim
Copy link

syedkibrahim commented Jan 5, 2024

We are trying to anonymize a DICOM file which is a JPEG2000Loseless type (Transfer Syntax ID - 1.2.840.10008.1.2.4.90)
But when we try to perform the .write() operation, we are getting an error:
First argument to DataView constructor must be an ArrayBuffer

But it's working fine for other DICOM file types.

We tried opening this file in MicroDicom Viewer and it's loading up fine.

Can anyone help understand why we might be getting this error ?

The steps we are using are as follows:

We are generating the buffer for the file and storing it in a variable named buffer.

const dicomDict = dcmjs.data.DicomMessage.readFile(buffer);

dicomDict.dict['00204000'].Value = 'DE-IDENTIFIED';
const deIdentifiedBuffer = dicomDict.write();

Which also brings me to the next question, is this the proper way to anonymize or should we be using the dicomDict.upsertTag() function ?

@pieper
Copy link
Collaborator

pieper commented Jan 6, 2024

Probably only a few transfer syntaxes were tested originally. I'm sure it would be possible to add support for that, but historically codecs haven't been easily dealt with. This is probably changing and it would be great if someone could investigate using dicom-codecs-wasmjs with dcmjs.

For anonymizing did you look at the existing code?

https://github.com/dcmjs-org/dcmjs/blob/master/src/anonymizer.js

https://github.com/dcmjs-org/dcmjs/blob/master/test/anonymizer.test.js

@syedkibrahim
Copy link
Author

Sure will take a look into that, thanks.
My follow up question is - Where can I find the list of transfer syntaxes supported by dcmjs and if that contains any compressed array buffer as well.
That might help us get a better understanding of how to handle this.

@pieper
Copy link
Collaborator

pieper commented Jan 8, 2024

I'm not sure but I believe only uncompressed pixel data is currently supported.

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

No branches or pull requests

2 participants