question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can we get the PixelData of the dicom image instead of converting it into an Uint16Array?

See original GitHub issue

Hi I have two server talking to each other one is python over which I am using pydicom, which sends the file to my node server. So in order to check the integrity of the images I wanted to apply a checksum with pixeldata on both the side. On pydicom when I happened to get the pixel data from dataset I get a big string of "\x00\x80B\xc3........" but when I happened to check the same on dicom parser for the same I get an object something like

{ tag: 'x7fe00010',
  vr: 'OW',
  length: 175186,
  dataOffset: 2334,
  hadUndefinedLength: true,
  encapsulatedPixelData: true,
  basicOffsetTable: [],
  fragments: [ { offset: 0, position: 2350, length: 175162 } ] } '

so anything can be done to get the same set of pixeldata ? or is there any way to get the encapsulatedPixelData with the help of this object which seems to be a meta-data

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
chafeycommented, Feb 10, 2020

Image Frame = single 2D image encoded in the specified transfer synbtax. Fragmentation = encoding an image frame into multiple pieces. These are both DICOM terms and you can read more about them in the DICOM standard if you wish. Getting an uncompressed 2D image frame is very complex in DICOM due to a variety of issues. If you just want to access 2D image frame buffer, you can see how CornerstoneImageLoader does it here:

https://github.com/cornerstonejs/cornerstoneWADOImageLoader/blob/master/src/imageLoader/wadouri/getPixelData.js

Note that this image frame will be encoded with the transfer syntax. You can see how CornerstoneWADOImageLoader decodes it here:

https://github.com/cornerstonejs/cornerstoneWADOImageLoader/blob/master/src/imageLoader/createImage.js#L69

1reaction
dannyrbcommented, Feb 10, 2020

Is anything floating around in the react-vtkjs-viewport library helpful for you @agirault? It’s using dicomParser, cornerstoneWADOImageLoader, and a dash of its own code to build vtk.js volumes:

https://github.com/OHIF/react-vtkjs-viewport/blob/master/src/lib/getImageData.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

display image by using uint16array data - javascript
During the rendering process, XTK provides an array of pixel data in an Uint16Array of each DICOM file. But I have no idea...
Read more >
Working with Pixel Data — pydicom 2.3.1 documentation
Some DICOM datasets store their output image pixel values in a lookup table (LUT), where the values in Pixel Data are the index...
Read more >
dicomParser/README.md at master · cornerstonejs ... - GitHub
dicomParser is a lightweight library for parsing DICOM P10 byte streams, ... example assumes 16 bit unsigned data) var pixelData = new Uint16Array(dataSet....
Read more >
DiDocument Class Reference - DCMTK
DiDocument Class Reference. Interface class to DICOM data management (dcmdata). ... convert pixel data to uncompressed representation (if required).
Read more >
Chapter 12: Pixel Data - DICOM is Easy
The first part of the application, up to line 87 (look for the comment "Setting the image pixel group elements") is rather standard....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found