Skip to content

Repository files navigation

DICOMParser

  • The open source code was downloaded from: https://sourceforge.net/projects/dicomparser/. DICOMParser is a small, lightweight C++ toolkit for reading DICOM format medical image files. It builds on several platforms including Linux, AIX, HP-UX, IRIX, SunOS, Visual C++, Borland C++, and Cygwin. DICOMParser is used in VTK and ITK.
  • To compile lib:
    • on VS, DICOM_EXPORT_SYMBOLS;DICOM_DLL; macro are needed.
    • on Linux, some small modification in code is needed to make sure strcmp could be correctly used.
  • To compile exe on VS:
    • the mainloop.cpp file is needed.
    • the The following code is an example about how to use DICOMParser.
DICOMAppHelperAppHelper;
DICOMParserParser;
conststd::stringFileName="0006.dcm";
Parser.ClearAllDICOMTagCallbacks();
Parser.OpenFile(FileName);
AppHelper.Clear();
AppHelper.RegisterCallbacks(&Parser);
AppHelper.RegisterPixelDataCallback(&Parser);
Parser.ReadHeader();
void*imgData=nullptr;
DICOMParser::VRTypesdataType;
unsigned longimageDataLength;
AppHelper.GetImageData(imgData, dataType, imageDataLength);
if (!imageDataLength)
{
printf("XXXXXXXXXXXXXX\n");
return-1;
}
shortaa=*((short*)imgData); // the image data from dcm file

About

DICOMParser

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages