The LEADTOOLS DICOM Edit Control property grid is a sophisticated control. It can be used to build an elegant DICOM editor with tooltips, selection list and data validation capabilities as well as to simply display detailed information stored in a DICOM file in an organized layout.
To add the DICOM Edit Control to your project, do the following:
- Add the Leadtools.Dicom.Common assembly to your project.
- Add the DicomPropertyGrid to your form.
To add a DICOM dataset to the property grid assign newly initialized or loaded Leadtools.Dicom.DicomDataSet object to the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.DataSet property of the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.
To switch between the module view and list view, use the Switch property.
The end-user can use the clickable commands in the DicomPropetyGrid’s Command pane to display or hide tag info. This can also be set programmatically using the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.ShowTagInfo property.
The user can reduce clutter by hiding some tags from being displayed(UID as an example). To hide tags add an event handler for the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.BeforeAddElement event and set the Leadtools.Dicom.Common.Editing.BeforeAddElementEventArgs Cancel property to true.
To add visual clue about the value requirement of a tag (i.e. DICOM Type 1, Type 2, Type 1C etc.) or to add tips or description about a tag do the following:
- Provide and event handler for the PropertyInfo event.
- Create a new Leadtools.Dicom.Common.Editing.PropertyInfoEventArgs.PropertyImageInfo Item. Assign an 8x8 image to the Leadtools.Dicom.Common.Editing.PropertyImageInfo.Image Property. Assign a string to Leadtools.Dicom.Common.Editing.PropertyImageInfo.Tooltip property to display a tooltip when the mouse is over the image.
- Add the new item to the Leadtools.Dicom.Common.Editing.PropertyInfoEventArgs.PropertyImageInfo property.
To limit the user selection options for a tag value to a specific list (i.e. enumerated or defined terms in DICOM or an implementation specific list) do the following:
- Provide an event handler for the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.BeforeAddElement event.
- Update the Leadtools.Dicom.Common.Editing.DicomEditableProperty.Choices string list property of the Leadtools.Dicom.Common.Editing.BeforeAddElementEventArgs.Element item. Items in this list will be presented as a combobox of choices in the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.
To add or remove some tags from the dataset do the following:
- To add tags to the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid call the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.AddTags(System.Collections.Generic.List{System.Int64}) method.
- To remove tag from the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid call the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.DeleteTag method.
- To use the provided tag selection dialog, call the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.ShowTagSelectionDialog method.
- To add tags from the property grid click on the Add Tag link. To add a sequence item click the Add Item link. To delete a tag click on the Delete Tag link. The Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid will disable and enable these links when appropriate.
- To check if a tag can be added read the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.CanAddTag property.
- To check if you can add a sequence item to the currently selected tag check the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.CanAddSequenceItem property.
The patient name value representation (VR) is handled automatically by the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid. The Leadtools.Dicom.Common assembly includes a Leadtools.Dicom.Common.Editing.Converters.PersonNameConverter, and Leadtools.Dicom.Common.Editing.Converters.PersonNameListConverter to convert Leadtools.Dicom.Common.Editing.Converters.PersonNameConverter, and Leadtools.Dicom.Common.DataTypes.PersonName to and from string representation.
In addition following user interface (UI) Methods are provided to simplify DICOM editing task:
- The DicomPropertyGrid includes some UITypeEditors that allow easier editing of DICOM images. The following editors are available:
- Sequence Editor – Edit DICOM sequence item.
- RasterImageEditor – Edit the Pixel Data item.
- Commands are provided that allow for common actions to be performed. The following actions are available:
- Show Tag Info – Show the tag information.
- Hide Tag Info – Hide the tag information.
- Add Tag – Add a tag to the dataset.
- Delete Tag – Delete a tag from the dataset.
- Add Item - Add an item to a sequence.
- To add images to the dataset do the following:
- Click on the “…†button next to the Pixel Data element. This will display an image editor dialog that allows you to update the Pixel Data Element.
- Uncheck the User Existing image to add an image to the dataset.
- To select the image encoding option to the following:
- Click on the “…†button next to the Pixel Data element. This will display an image editor dialog that allows you to update the Pixel Data Element.
- Choose the appropriate options on the dialog.
Changes made in the Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid automatically updates the attached Leadtools.Dicom.DicomDataSet; which can be used to save the updated dataset to disk.
Please, refer to Print To PACS or DICOM High-level MWL SCU demo source project for sample implementation of Leadtools.Dicom.Common.Editing.Controls.DicomPropertyGrid.