Search code examples
dicomclearcanvas

ClearCanvas SDK


I would like to experiment with the ClearCanvas SDK inside of another project. I am not looking to make any changes to the code whatsoever. So how do I get this code and include it in another project? Do I need to Build it via the Github instructions or can I just download the zip, open in VS and reference the CC solution?

Here’s a little detail to what I would like to do. I am looking to use CC to read dicom tags and collect the dat from those tags. Initially, that is all I’d like to do with CC.

Thanks in advance.


Solution

  • Ok I will answer this question. First you need to go to GitHub and download and compile the source to produce the binaries. The only other choice is to use the old ones for 2.0 SP1. That is the last I remember Clear Canvas themselves providing the binaries for download. They no longer do and you would have to search to find it.

    Once you have the binaries you can create a windows form application. Put the binaries in the debug folder after building. Add then a reference by browsing to the DLL.

    These are the ones I always use:

    ClearCanvas.Common.dll
    ClearCanvas.Desktop.dll
    ClearCanvas.Dicom.dll
    log4net.dll
    

    Then add the code to the form class:

    using ClearCanvas.Dicom;
    using ClearCanvas.Dicom.Network;
    using ClearCanvas.Common;
    

    Once This is in place you should be able to write code like:

    >DicomFile f = new DicomFile(@"C:\33d70014.dcm");
    >f.Load();
    >f.DataSet[DicomTags.NameOfPhysiciansReadingStudy].SetString(0,"MedicalIDD^LastNameD^FirstNameD^MiddleNameD");
    >f.Save(@"C:\33d70014_1.dcm");
    

    This code simply loads an existing DICOM file, changes the value of one tag, and saves the file under a new name.

    Please see the answer I wrote to the question of how to send DICOM with Clear Canvas:

    Sending dicom file to a remote AE using c# in visual studio 2010

    That code works for everything I needed it to.