0
votes

I am in the process of developing a DICOM solution that needs to target .Net 4.0 and get access to the raw pixel data for annotation. As such, I am using the end-of-the-road tag to compile my program. I am working with a US Echo image from Philip Xcelera R4.1 L1 system. The photometric interpretation shows as RGB in the header and the transfer syntax is JPEG Base line 1.2.840.10008.1.2.4.50. When I open the file in fo-dicom, how can I access the raw RGB data? I need to put annotation right on to the pixel data and save it base.

When I do open it and look in the debugger, var img = new DicomImage(fullImagePath); the DICOM image says it is an YBR-FULL:422. I am not sure where it gets that from? The image header says RGB. Is that an issue with the image or there is a bug in the older version of the library?

Thanks.

EDIT: The photometric interpretation issues is actually a non-issue. The viewer MicroDicom was showing wrong value as RGB, when I actually looked at the bytes, it is YBR-FULL:422 there and everything matches. However I still want answer to how to get to the pixel data.

1

1 Answers

1
votes

If you have opened the Image as DicomImage with eg:

var dcm = new DicomImage(DicomFile.Open("filename.dcm").Dataset);

then you should get what you want by:

byte[] rawPixelData = dcm.PixelData.GetFrame(0).Data;