Using DicomObjects in Python

DicomObjects can be used in python by the help of various api's and interface generators

COM version: (This instructions below is using pywin32 interface generator for COM objects)

  1. Download and install appropriate pywin32 tool from here:
  2. Run the script from "\Lib\site-packages\win32com\client\"
  3. Select DicomObjects6 from the list of registered COM/ActiveX components on your system
  4. A module is generated under "<python_install_path>\Lib\site-packages\win32com\gen_py\"
  5. Download our python sample script from here and run it using the command : python


.NET version: In this article, we used IronPython to call the .NET version of DicomObjects:

  1. Download and Install IronPython from here:
  2. Open IronPython Console
  3. Run the following commands:
    1. import clr
    2. clr.AddReferenceToFileAndPath(Full_Path_To_DicomObjects.NET_DLL)
    3. import DicomObjects
  4. Test to see if it works:
    1. print DicomObjects.DicomGlobal.FileVersion
    2. print DicomObjects.DicomGlobal.Echo("", 104, "PySCU","DicomServer") this should print 0 on console screen