dcmjs icon indicating copy to clipboard operation
dcmjs copied to clipboard

Change in PixelSequence value

Open syedkibrahim opened this issue 1 year ago • 1 comments

We tried anonymizing a few tags for different DICOM file types (Little Endian Explicit, JPEGLoseless) using the below approach and it seems to be working fine. However, when we compared the modified DICOM file with the original one, it seems that the PixelSequence value gets changed even if we don't make any changes to the pixel data.

Before: (7fe0, 0010) OB (PixelSequence #= 185)

After: (7fe0, 0010) OB (PixelSequence #= 735)

Code:

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

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

My question is, does the dicomDict.write() function affect pixel data even if we perform de-identification on some other tags ?

syedkibrahim avatar Jan 12 '24 11:01 syedkibrahim

As noted in #375 there hasn't been much testing or development with compressed images so if the results are incorrect someone would need to debug. It shouldn't be much work to single step through the tag writing code to see what's happening.

pieper avatar Jan 12 '24 18:01 pieper