dcmjs
dcmjs copied to clipboard
Cannot read property 'Rows' of undefined
Create and read RLE encoded DICOM Segmentation with Cornerstone Example: https://dcmjs.netlify.app/createsegmentationrleroundtrip/


Display DICOM Segmentation with Cornerstone Example: https://dcmjs.netlify.app/displaysegmentation/


Thanks for reporting this, I'm able to reproduce it. My guess is that something has changed in cornerstone or else this version of the segmentation example isn't working for some reason (I know earlier versions did). I appreciate any help you can provide troubleshooting this to fix the example, maybe by reverting versions of this code or cornerstone.
If you want more fully worked out solution you can look at OHIF, for example (here)
Steve, did we test OHIF with RLE-encoded SEGs? Those I know of are just bit-packed, not RLE encoded.
Good point, this example is from @JamesAPetts to do RLE. So I can't actually say. I hope he's able to confirm that this did work when committed and maybe that will give a clue about why it might not be working now.
Hey, yeah this demo worked when it was built.
I don't think it reflects commonly available data though, its RLE with the liberal abuse of FRACTIONAL SegmentationType to make files with many segments (e.g. Freesurfer segmentations) as small as possible, as these didn't scale well with binary due to their being loads and loads of zeroes per segment frame.
I don't think we ended up using it anywhere yet to build examples, hence the "create-and-read" demo.
Im also facing the same issue, Any progress on this one. Do we need to use any specific version of cornerstone.js
I don't think anyone has had a chance to look into this. I know there is more focus coming soon on segmentations using cornerstone (3D) and OHIF but I'm not sure of the exact timeline. You could try looking back for previous versions of cornerstone at around the time this demo was created, but better if you could debug and adapt it to work with current code.
There is another solution:
Is to ignore "sourceImageMetadata".
Before: https://github.com/dcmjs-org/dcmjs/blob/c209047861d2ef6c17526c6d1e29d5db7e895b29/src/adapters/Cornerstone/Segmentation_4X.js#L936-L949
After:
/* const sourceImageMetadata = metadataProvider.get(
"instance",
imageId
);
if (
Rows !== sourceImageMetadata.Rows ||
Columns !== sourceImageMetadata.Columns
) {
throw new Error(
"Individual SEG frames have different geometry dimensions (Rows and Columns) " +
"respect to the source image reference frame. This is not yet supported. " +
"Aborting segmentation loading. "
);
} */
I've already tested my platform and it works export and import segmentation.