I am trying to follow the tutorial here:
http://www.rexcardan.com/2014/10/evil-dicom-basics/
and process my DICOM file to show the image. In the tutorial, the DICOMObject.Open() method is called to process the file path. My issue is that intellisense does not pick this up for me. Would anyone be able to assist with this?
I downloaded this version:
https://github.com/rexcardan/Evil-DICOM
EDIT
Using the following:
var dcm = DICOMObject.Read(@"C:\file\path\filename.dcm");
While stepping through the code of DICOMObject
everything seems to be working fine up to this point:
public static IDICOMElement ReadElementImplicitLittleEndian(DICOMBinaryReader dr)
{
var tag = TagReader.ReadLittleEndian(dr);
var vr = TagDictionary.GetVRFromTag(tag);
int length = LengthReader.ReadLittleEndian(VR.Null, dr);
var data = DataReader.ReadLittleEndian(length, dr, TransferSyntax.IMPLICIT_VR_LITTLE_ENDIAN);
var el = ElementFactory.GenerateElement(tag, vr, data, TransferSyntax.IMPLICIT_VR_LITTLE_ENDIAN);
return el;
}
When the code gets to:
int length = LengthReader.ReadLittleEndian(VR.Null, dr);
length
returns an int
of 1919252000 bytes
which is ~2GB. Then the code steps to:
var data = DataReader.ReadLittleEndian(length, dr, TransferSyntax.IMPLICIT_VR_LITTLE_ENDIAN);
Which checks to see if there are any bytes to read (which there is) and goes to the read bytes here:
public byte[] ReadBytes(int count)
{
byte[] buffer = new byte[count];
_binaryReader.Read(buffer, 0, count);
return buffer;
}
byte[] buffer = new byte[count];
is where the actual exception occurs in the code. I have tested the amount of bytes that it can handle and it seems to be around .6 - .7 GB
which is not even half of what I need. Is there away to expand the buffer to accept all of what I need?
I have not looked at the video, but as far as I know you should use:
var dicomObj = DICOMObject.Read(filePath);
to read a DICOM file using Evil DICOM.
Please see the source code here. I am not sure, but there may have been a recent API change that explains this confusion.