Upgrading to DicomObjects 6.0

  1. .NET
  2. COM

Changes to DicomObjects.NET Version 6

Rationale

The namespace used in DicomObjects.NET 5.x had become quite "messy" with a complex set of nested classes, and no clear pattern to where objects could be found, making intellisense less usable, and development more complex than it need be.  This has been "fixed" in version 6, with movement of all sub-classes into the top level of their respective namespaces, which are:

  • Main objects
  • Enumerations
  • Delegates
  • Event Arguments
  • DicomUIDs (just constants)
  • Internal (not for general use)

This will require slight code changes as described below, but all issues should be found at compile time.

In addition, the following other types of change were made:

  • Preparations for DICOM asynchronous operations (in a later release)
  • Removal of implicit object creation, as that had been causing confusion.

Required code changes:

  1. By far the majority of changes can easily be accomplished by removing any prepended parent class names, and then using "resolve" to add any necessary "using" statements.   So for instance any references to:

    DicomServer.AssociationRequestHandler (a nested class)

    Should become:

    DicomObjects.Delegates.AssociationRequestHandler
     

  2. Logging levels are now listed using the DicomObjects.Enums.LogLevel enumeration, rather than just numbers, though the numbers remain the same, so of course you may simply cast as necessary.
     
  3. The “Add” method of collections has been changed to remove some overloads which automatically generated new objects, in particular DicomImageCollection.Add no longer accepts a DicomDataSet parameter, so if you wish to add an image created from a dataset to a collection, then you must call the constructor explicitly, with a call such as images.Add(new DicomImage(dataset));

Advisory changes

A future version of DicomObjects will support DICOM asynchronous operations, and there may therefore be several operations outstanding on a given association.  This would be a problem for the current model, whereby important details about the incoming request, and the means to send reply information are handled via the association object.  Therefore all such access has now been deprecated, with warnings, and you are advised (though not currently required) to operate directly via the event argument, rather than the association, so for instance:

        void Server_QueryReceived(object Sender, DicomObjects.EventArguments.QueryReceivedArgs e)
        {

            DicomDataSet query = e.Association.Request;

            // calculate response from query

            e.Association.SendResponse(response, 0xFF00);
            e.Status = 0;
        }

Should become:

        void Server_QueryReceived(object Sender, DicomObjects.EventArguments.QueryReceivedArgs e)
        {
            DicomDataSet query = e.Request;

            // calculate response from query

            e.SendResponse(response, 0xFF00);
            e.Status = 0;
        }

We have made it our priority to maintain compatibility with any existing code in our latest DicomObjects, supporting .NET 3.5 and 4.0, both of which are fairly similar but to avoid any possible conflicts we would release respective packages.

A few things/changes to remember :

  1. Change the project framework from 2.0 to your target framework (3.5  or  4.0)
  2. Update reference to your latest version of DicomObjects (3.5 or 4.0 respectively)
  3. Check for warning and/or errors generated.

 

 

Changes to DicomObjects.COM Version 6

Required code changes:

  • References in your project need to be updated to DicomObjects6 and most importantly any references to old COM, DicomObjects (without 6 as a suffix), has to be removed to avoid conflicts and undesirable behaviour.
  • Similarly other direct references to DO have to be updated as well,   e.g.  :   DicomObjects.DicomImage  to  DicomObjects6.DicomImage
  • Noticeable changes to event handlers is given in this VB6 example code, where the last two parameters are Single instead Long :    Viewer_MouseMove(Button As Integer, Shift As Integer, X As Long, Y As Long)  to  Viewer_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

There are few other minor changes you may notice within your existing code, but nothing radically different.

 

 

Functionality wise, there is nothing significantly different in our new release so any errors/warning that you're not sure of can be clarified with our support team:  support@medicalconnections.co.uk

 

Relevance: