How to Implement Shutters in DicomObjects

Shutters are a means to "black out" areas of an image outside the area of interest, and are defined in DICOM and in presentation states.

Contents

Implementing Shutters in the COM Version of DicomObjects

In COM version of DicomObjects, users have to manually add in Shutter-Related DICOM tags to define the shape and the size of the Shutter.

Circular Shutter

Image.Attributes.Add &H18, &H1600, "CIRCULAR"  'Shutter Shape
centre(1) = Image.SizeY / 2 'Y Coordinate of the Center
centre(2) = Image.SizeX / 2 'X Coordinate of the Center
'Note order must be Y, X
Image.Attributes.Add &H18, &H1610, centre ' Center of Circular Shutter
Image.Attributes.Add &H18, &H1612, Image.SizeX / 2 'Radius of Circular Shutter

Rectangular Shutter

Image.Attributes.Add &H18, &H1600, "RECTANGULAR"  'Shutter Shape
Image.Attributes.Add &H18, &H1602, Image.SizeX / 5   'Shutter Left Vertical Edge 
Image.Attributes.Add &H18, &H1604, Image.SizeX - Image.SizeX / 5 'Shutter Right Vertical Edge
Image.Attributes.Add &H18, &H1606, Image.SizeY - Image.SizeY / 5 'Shutter Upper Horizontal Edge
Image.Attributes.Add &H18, &H1608, Image.SizeY / 5 'Shutter Lower Horizontal Edge

Implementing Shutters in the .NET Version of DicomObjects

In .NET version of DicomObjects, Shutters can be represented by DicomLabel objects, so users don't have to search the DICOM Standard for the corresponding attributes for Shutter. This is achieved by using the isShutter property - setting this to true causes the brush to be applied outside the area of the label rather than inside.

Circular Shutter

Dim shutter As New DicomObjects.DicomLabel
shutter.LabelType = DicomObjects.Enums.LabelType.Ellipse  'Ellipse and Circle
shutter.isShutter = True  'Needs to be set to TRUE
'Location and Size of the Label
shutter.Left = 100
shutter.Top = 100
shutter.Width = 300
shutter.Height = 300
DicomViewer1.CurrentImage.Labels.Add(shutter)

Rectangular Shutter

Dim shutter As New DicomObjects.DicomLabel
shutter.LabelType = DicomObjects.Enums.LabelType.Rectangle 'Rectangle and Square
shutter.isShutter = True  'Needs to be set to TRUE
'Location and Size of the Label
shutter.Left = 100
shutter.Top = 100
shutter.Width = 300
shutter.Height = 300
DicomViewer1.CurrentImage.Labels.Add(shutter)
Relevance: