Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A C# DICOM Library

branch: master

Alt text

Portable Evil DICOM - A DICOM library in C#

Copyright (c) 2011-2013 Rex Cardan, Portable Class Library adaptation (c) 2012-2013 Anders Gustafsson, Cureos AB

This project is a Portable Class Library adapted fork of Rex Cardan's original Evil DICOM library. For general information and tutorials, see here.


The EvilDicom.Core Visual Studio solution contains a Portable Class Library project, a .NET 4 project for the class that cannot be represented in PCL, and a unit test project. The PCL library EvilDICOM.Core supports the following targets:

  • .NET Framework version 4 and higher
  • Silverlight version 4 and higher
  • Windows Phone version 7 and higher
  • Xbox 360
  • Windows Store Applications (a.k.a. Metro or Windows 8 applications)

The exact same source code can also be incorporated in a class library targeting Mono for Android ( Xamarin.Android ) or Monotouch ( Xamarin.iOS ).

Public API Differences

To meet the requirements of a Portable Class Library project, the PCL library public API differs from Rex Cardan's original .NET 4 library as follows:

  • DICOMBinaryReader and DICOMBinaryWriter constructors, DICOMFileReader.Read, DICOMFileReader.ReadFileMetadata and DICOMFileWriter.WriteLittleEndian methods takes a Stream argument instead of file path string.
  • DICOMNetworkBinaryReader is excluded in the PCL library due to its dependency to the Socket class. This class is instead incorporated in the .NET 4 class library EvilDICOM.Desktop.

PCL example usage

Read a DICOM file with the name path:

var dcm = DICOMFileReader.Read(File.OpenRead(path));            // .NET and Silverlight elevated trust applications

Write DICOM object dcm to a file with the name path:

DICOMFileWriter.WriteLittleEndian(File.OpenWrite(path), dcm);   // .NET and Silverlight elevated trust applications
Something went wrong with that request. Please try again.