DicomLabels of type doLabelSpecial are used where the text content is determined by DicomObjects rather than by the programmer. The first use is for anatomic side markers, but the more general name has been used, as other types may be used in the future.
Anatomic side markers are created by setting the Text property of the DicomLabel to one of the following 4 values:
If an unrecognised value is used, or if the image lacks the necessary DICOM attributes then the label will simply not be displayed.
If the label can be displayed, then DicomObjects calculates, using the orientation information within the image which anatomic direction(s) correspond with the selected edge of the image as displayed and (unless changed as below) will display one or more of the following characters R,L,A,P,I or S, corresponding to right, left, anterior, posterior, inferior and superior respectively. Where the image orientation is oblique, 2 or more characters will be displayed, in decreasing order of importance,
If writing an application for users who’s language is not English, you may wish to localise the characters used, and this can be done by setting the DirectionStrings property of a DicomGlobal object.
When interpreting this property, DicomObjects uses only the value of the text property to calculate the string displayed, not the position of the label, so it is the programmer’s responsibility to ensure that the position and content correspond by placing the label close to the appropriate edge. It is particularly important to ensure that width and height have non-zero but relatively small values, so that the label stays in the correct place when the image is flipped or rotated.
If the ImageTied property is true, then rotation or flipping of the image cause the label to move, but the text remains constant. If ImageTied is false, then label remains fixed in position, but the text alters to reflect the position of the image. In either case, the information should remain anatomically correct.
If you use this feature, you are strongly advised to use at least two markers, to prevent confusion between orientation and side markers. To make this distinction clear, consider an image of the right leg. If only a single side label is used, at the side of the image corresponding with the midline of the patient, this will be labelled "L" for left, which is correct as far as orientation is concerned, but could confuse users, who might think that they were being shown the left leg. However, if both R and L markers are present, then they could only be orientation markers, and the potential confusion is removed.
Following VB6 code shows how to use the Special Labels in DicomObjects:
Dim l As DicomImage Set l = MarkerLabel(Image) l.Left = 0 l.Top = 500 l.Text = "LEFT" Set l = MarkerLabel(Image) l.Left = 500 - l.width / 2 l.Top = 0 l.Alignment = doAlignCentre l.Text = "TOP" Set l = MarkerLabel(Image) l.Left = 1000 - l.width l.Top = 500 l.Alignment = doAlignRight l.Text = "RIGHT" Set l = MarkerLabel(Image) l.Left = 500 - l.width / 2 l.Top = 1000 - l.Height l.Alignment = doAlignBottomCentre l.Text = "BOTTOM" Image.Refresh True
Private Function MarkerLabel(Image As DicomImage) As DicomLabel Set MarkerLabel = Image.Labels.AddNew MarkerLabel.LabelType = doLabelSpecial MarkerLabel.ScaleWithCell = True MarkerLabel.ScaleFontSize = False MarkerLabel.width = 200 MarkerLabel.Height = 200 MarkerLabel.ForeColour = vbRed MarkerLabel.Margin = 2 End Function