ImageGear Professional for Windows ActiveX
Using ImageGear MD Component

The IGMedCtl Control is used for several purposes. It is a Format Filter, and as such is used exactly like the other Format Filters described in the Loading, Saving, and Acquiring Images section. It allows your application to load and save images in the DICOM file format. In addition, it contains functions like those in IGPageDisplay Object that are used to control the rendering of the DICOM image. Also, it has some image-manipulation functions, like those in IGProcessingCtl Control. Finally, it contains functions for reading, creating and maintaining the non-image data (the Part-10 header and the Data Set), like those in Working with Non-Image Data.

The format support of the MD component includes loading and saving grayscale, palettized, and True color medical images using the following file formats:

In addition, your application will continue to support all ImageGear-supported file formats-meaning that you can convert an image of a different format to a medical image format, and vice versa.

As described in Operational Concepts section, you use the IGMedCtl Control ActiveX control by placing it into the UI of your application, using the graphic designer of your development environment. In the code for your application, in the startup sequence, you must associate the control with your IGCoreCtl Control, before calling any of its methods:

 
Copy Code
IGCoreCtl1.License.SetSolutionName "Accusoft"
IGCoreCtl1.Result.NotificationMode = IG_ERR_NO_ACTION
IGCoreCtl1.AssociateComponent IGMedCtl1.ComponentInterface

If your application needs to access the Data Set or the Part 10 Header in the DICOM file (the non-image data), then it will need a data dictionary object (this object contains the "schema" of the DICOM Data Set, which defines the hierarchical organization of the tags in the Data Set). Obtaining the data dictionary is simple:

 
Copy Code
Dim datadict As IGMedDataDict
Set datadict = IGMedCtl1.DataDict

Your application must then create an IGPage Object, plus an IGMedPage Object (this holds the non-image data from the DICOM file), and load a DICOM file into them. The following example shows the use of LoadPageFromFile Method, but any of the techniques in Loading, Saving, and Acquiring Images section could be used:

 
Copy Code
Dim page As IGPage
Dim medpage as IGMedPage
IGCoreCtl1.AssociateComponent IGFormatsCtl1.ComponentInterface
Set page = IGCoreCtl1.CreatePage
Set medpage = IGMedCtl1.CreateMedPage(page)
IGFormatsCtl1.LoadPageFromFile page, "myfile.dcm", 0

Next, your application must create an IGPageDisplay Object for the IGPage Object, and then associate the IGPageDisplay Object with the IGPageViewCtl Control in the user interface.. This is done as follows:

 
Copy Code
Dim display As IGPageDisplay
Set display = IGDisplayCtl1.CreatePageDisplay(page, True)
IGPageViewCtl1.PageDisplay = display

At this point, the image is displayed in the application's user interface. Your application program can perform specialized 12- and 16-bit grayscale display functions by accessing the IGMedDisplay Object associated with your IGMedPage Object. For example, to reset the contrast Window Level, do the following:

 
Copy Code
Dim contrast As IGMedContrast
Set contrast = IGMedCtl1.CreateObject(MED_OBJ_CONTRAST)
contrast.WindowCenter = 4096
contrast.WindowWidth = 1024
medpage.Display.AdjustContrastAuto contrast
IGPageViewCtl1.UpdateView

Your application can perform specialized 12- and 16-bit grayscale image processing by accessing the IGMedProcessing Object associated with your IGMedPage Object. For example, to convert a 12-bit image to 8-bit using the current Window Level settings, do the following:

 
Copy Code
medpage.Processing.ReduceWithDisplayLUT
IGPageViewCtl1.UpdateView

Finally, your application can perform DICOM Part 10 Header and Data Set functions by accessing the IGMedDataElem Object associated with your IGMedPage Object. For example, the following code gets the VR info from the first element in the DICOM Data Set:

 
Copy Code
Dim CurrElem As IGMedDataElem
Dim VRInfo As IGMedVRInfo
medpage.DataSet.MoveFirst MED_DCM_MOVE_LEVEL_FLOAT
Set CurrElem = medpage.DataSet.CurrElem
Set VRInfo = MedDataDict.GetVRInfo(CurrElem.VR)

Please refer to the MD Component API Reference for complete descriptions of the IGMedCtl Control functionality.

This section provides information about the following:

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback