Leadtools.MedicalViewer Requires Medical Imaging license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
MedicalViewer Class
See Also  Members   Example 
Leadtools.MedicalViewer Namespace : MedicalViewer Class



Represents a LEADTOOLS MedicalViewer control for displaying medical images.

Object Model



Syntax

Visual Basic (Declaration) 
Public Class MedicalViewer 
   Inherits Control
Visual Basic (Usage)Copy Code
Dim instance As MedicalViewer
C# 
public class MedicalViewer : Control 
C++/CLI 
public ref class MedicalViewer : public Control 

Example

For an example, refer to MedicalViewer Create the control and add some image

Visual BasicCopy Code
<Test> _
Public Sub MedicalViewerExample()
   Dim form As MainForm1 = New MainForm1()
   form.ShowDialog()
End Sub
' MainForm1 will be the owner of the medical viewer control.
Private Class MainForm1 : Inherits Form
   Private _medicalViewer As MedicalViewer

   Public Sub New()
      RasterCodecs.Startup()
      Dim _codecs As RasterCodecs = New RasterCodecs()
      Dim _image As RasterImage

      ' Create the medical viewer and adjust the size and the location.
      _medicalViewer = New MedicalViewer(1, 2)
      _medicalViewer.Location = New Point(0, 0)
      _medicalViewer.Size = New Size(Me.ClientRectangle.Right, Me.ClientRectangle.Bottom)

      ' add some action that will be used to change the properties of the images inside the control.
      _medicalViewer.AddAction(MedicalViewerActionType.WindowLevel)
      _medicalViewer.AddAction(MedicalViewerActionType.Scale)
      _medicalViewer.AddAction(MedicalViewerActionType.Offset)
      _medicalViewer.AddAction(MedicalViewerActionType.Stack)

      ' assign the added actions to a mouse button, meaning that when the user click and drag the mouse button, the associted action will be activated.
      _medicalViewer.SetAction(MedicalViewerActionType.WindowLevel, MedicalViewerMouseButtons.Left, MedicalViewerActionFlags.Active Or MedicalViewerActionFlags.RealTime)
      _medicalViewer.SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active Or MedicalViewerActionFlags.RealTime)
      _medicalViewer.SetAction(MedicalViewerActionType.Scale, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active Or MedicalViewerActionFlags.RealTime)
      _medicalViewer.SetAction(MedicalViewerActionType.Stack, MedicalViewerMouseButtons.Wheel, MedicalViewerActionFlags.Active Or MedicalViewerActionFlags.RealTime)

      ' assign the added actions to a keyboard keys that will work like the mouse.
      Dim medicalKeys As MedicalViewerKeys = New MedicalViewerKeys(Keys.Down, Keys.Up, Keys.Left, Keys.Right, MedicalViewerModifiers.None)
      _medicalViewer.SetActionKeys(MedicalViewerActionType.Offset, medicalKeys)
      medicalKeys.Modifiers = MedicalViewerModifiers.Ctrl
      _medicalViewer.SetActionKeys(MedicalViewerActionType.WindowLevel, medicalKeys)
      medicalKeys.MouseDown = Keys.PageDown
      medicalKeys.MouseUp = Keys.PageUp
      _medicalViewer.SetActionKeys(MedicalViewerActionType.Stack, medicalKeys)
      medicalKeys.MouseDown = Keys.Subtract
      medicalKeys.MouseUp = Keys.Add
      _medicalViewer.SetActionKeys(MedicalViewerActionType.Scale, medicalKeys)

      ' Load an image and then add it to the control.
      _image = _codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "image3.cmp")
      _medicalViewer.Cells.Add(New MedicalViewerCell(_image, True))

      ' adjust some properties to the cell and add some tags.
      _medicalViewer.Cells(0).SetTag(2, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "EX. ID 230-36-5448")
      _medicalViewer.Cells(0).SetTag(4, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame)
      _medicalViewer.Cells(0).SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Scale)
      _medicalViewer.Cells(0).SetTag(2, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.WindowLevelData)
      _medicalViewer.Cells(0).SetTag(1, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.FieldOfView)
      _medicalViewer.Cells(0).SetTag(1, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "Good, Guy")
      _medicalViewer.Cells(0).SetTag(2, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "PID 125-98-445")
      _medicalViewer.Cells(0).SetTag(3, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "DOB 08/02/1929")
      _medicalViewer.Cells(0).SetTag(5, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "03/16/1999")
      _medicalViewer.Cells(0).SetTag(0, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.RulerUnit)
      _medicalViewer.Cells(0).Rows = 1
      _medicalViewer.Cells(0).Columns = 1
      _medicalViewer.Cells(0).Frozen = False
      _medicalViewer.Cells(0).DisplayRulers = MedicalViewerRulers.Both
      _medicalViewer.Cells(0).ApplyOnIndividualSubCell = False
      _medicalViewer.Cells(0).ApplyActionOnMove = True
      _medicalViewer.Cells(0).FitImageToCell = True
      _medicalViewer.Cells(0).Selected = True
      _medicalViewer.Cells(0).ShowTags = True

      ' Load an image and then add it to the control.
      _image = _codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "image2.cmp")
      _medicalViewer.Cells.Add(New MedicalViewerCell(_image))

      ' adjust some properties to the cell and add some tags.
      _medicalViewer.Cells(1).SetTag(2, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "EX. ID 230-36-5448")
      _medicalViewer.Cells(1).SetTag(4, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame)
      _medicalViewer.Cells(1).SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Scale)
      _medicalViewer.Cells(1).SetTag(2, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.WindowLevelData)
      _medicalViewer.Cells(1).SetTag(1, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.FieldOfView)
      _medicalViewer.Cells(1).SetTag(1, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "Good, Guy")
      _medicalViewer.Cells(1).SetTag(2, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "PID 125-98-445")
      _medicalViewer.Cells(1).SetTag(3, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "DOB 08/02/1929")
      _medicalViewer.Cells(1).SetTag(5, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "03/16/1999")
      _medicalViewer.Cells(1).SetTag(0, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.RulerUnit)
      _medicalViewer.Cells(1).Rows = 2
      _medicalViewer.Cells(1).Columns = 2
      _medicalViewer.Cells(1).Frozen = False
      _medicalViewer.Cells(1).DisplayRulers = MedicalViewerRulers.Both
      _medicalViewer.Cells(1).ApplyOnIndividualSubCell = False
      _medicalViewer.Cells(1).ApplyActionOnMove = True
      _medicalViewer.Cells(1).FitImageToCell = True
      _medicalViewer.Cells(1).Selected = True
      _medicalViewer.Cells(1).ShowTags = True

      RasterCodecs.Shutdown()
      Controls.Add(_medicalViewer)
   End Sub
End Class
C#Copy Code
public void MedicalViewerExample() 

   MainForm1 form = new MainForm1(); 
   form.ShowDialog(); 

 
// MainForm1 will be the owner of the medical viewer control. 
class MainForm1 : Form 

   private MedicalViewer _medicalViewer; 
 
   void MedicalViewerForm_SizeChanged(object sender, EventArgs e) 
   { 
      _medicalViewer.Size = new Size(this.ClientRectangle.Right, this.ClientRectangle.Bottom); 
   } 
 
   public MainForm1() 
   { 
      RasterCodecs.Startup(); 
      RasterCodecs _codecs = new RasterCodecs(); 
      RasterImage _image; 
 
      // Create the medical viewer and adjust the size and the location. 
      _medicalViewer = new MedicalViewer(1, 2); 
      _medicalViewer.Location = new Point(0, 0); 
      _medicalViewer.Size = new Size(this.ClientRectangle.Right, this.ClientRectangle.Bottom); 
 
      // add some action that will be used to change the properties of the images inside the control. 
      _medicalViewer.AddAction(MedicalViewerActionType.WindowLevel); 
      _medicalViewer.AddAction(MedicalViewerActionType.Scale); 
      _medicalViewer.AddAction(MedicalViewerActionType.Offset); 
      _medicalViewer.AddAction(MedicalViewerActionType.Stack); 
 
      // assign the added actions to a mouse button, meaning that when the user click and drag the mouse button, the associted action will be activated. 
      _medicalViewer.SetAction(MedicalViewerActionType.WindowLevel, MedicalViewerMouseButtons.Left, MedicalViewerActionFlags.Active | MedicalViewerActionFlags.RealTime); 
      _medicalViewer.SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active | MedicalViewerActionFlags.RealTime); 
      _medicalViewer.SetAction(MedicalViewerActionType.Scale, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active | MedicalViewerActionFlags.RealTime); 
      _medicalViewer.SetAction(MedicalViewerActionType.Stack, MedicalViewerMouseButtons.Wheel, MedicalViewerActionFlags.Active | MedicalViewerActionFlags.RealTime); 
 
      // assign the added actions to a keyboard keys that will work like the mouse. 
      MedicalViewerKeys medicalKeys = new MedicalViewerKeys(Keys.Down, Keys.Up, Keys.Left, Keys.Right, MedicalViewerModifiers.None); 
      _medicalViewer.SetActionKeys(MedicalViewerActionType.Offset, medicalKeys); 
      medicalKeys.Modifiers = MedicalViewerModifiers.Ctrl; 
      _medicalViewer.SetActionKeys(MedicalViewerActionType.WindowLevel, medicalKeys); 
      medicalKeys.MouseDown = Keys.PageDown; 
      medicalKeys.MouseUp = Keys.PageUp; 
      _medicalViewer.SetActionKeys(MedicalViewerActionType.Stack, medicalKeys); 
      medicalKeys.MouseDown = Keys.Subtract; 
      medicalKeys.MouseUp = Keys.Add; 
      _medicalViewer.SetActionKeys(MedicalViewerActionType.Scale, medicalKeys); 
 
      // Load an image and then add it to the control. 
      _image = _codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "image3.cmp"); 
      _medicalViewer.Cells.Add(new MedicalViewerCell(_image, true)); 
 
      // adjust some properties to the cell and add some tags. 
      _medicalViewer.Cells[0].SetTag(2, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "EX. ID 230-36-5448"); 
      _medicalViewer.Cells[0].SetTag(4, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame); 
      _medicalViewer.Cells[0].SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Scale); 
      _medicalViewer.Cells[0].SetTag(2, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.WindowLevelData); 
      _medicalViewer.Cells[0].SetTag(1, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.FieldOfView); 
      _medicalViewer.Cells[0].SetTag(1, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "Good, Guy"); 
      _medicalViewer.Cells[0].SetTag(2, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "PID 125-98-445"); 
      _medicalViewer.Cells[0].SetTag(3, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "DOB 08/02/1929"); 
      _medicalViewer.Cells[0].SetTag(5, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "03/16/1999"); 
      _medicalViewer.Cells[0].SetTag(0, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.RulerUnit); 
      _medicalViewer.Cells[0].Rows = 1; 
      _medicalViewer.Cells[0].Columns = 1; 
      _medicalViewer.Cells[0].Frozen = false; 
      _medicalViewer.Cells[0].DisplayRulers = MedicalViewerRulers.Both; 
      _medicalViewer.Cells[0].ApplyOnIndividualSubCell = false; 
      _medicalViewer.Cells[0].ApplyActionOnMove = true; 
      _medicalViewer.Cells[0].FitImageToCell = true; 
      _medicalViewer.Cells[0].Selected = true; 
      _medicalViewer.Cells[0].ShowTags = true; 
 
      // Load an image and then add it to the control. 
      _image = _codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "image2.cmp"); 
      _medicalViewer.Cells.Add(new MedicalViewerCell(_image)); 
 
      // adjust some properties to the cell and add some tags. 
      _medicalViewer.Cells[1].SetTag(2, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "EX. ID 230-36-5448"); 
      _medicalViewer.Cells[1].SetTag(4, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame); 
      _medicalViewer.Cells[1].SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Scale); 
      _medicalViewer.Cells[1].SetTag(2, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.WindowLevelData); 
      _medicalViewer.Cells[1].SetTag(1, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.FieldOfView); 
      _medicalViewer.Cells[1].SetTag(1, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "Good, Guy"); 
      _medicalViewer.Cells[1].SetTag(2, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "PID 125-98-445"); 
      _medicalViewer.Cells[1].SetTag(3, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "DOB 08/02/1929"); 
      _medicalViewer.Cells[1].SetTag(5, MedicalViewerTagAlignment.TopRight, MedicalViewerTagType.UserData, "03/16/1999"); 
      _medicalViewer.Cells[1].SetTag(0, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.RulerUnit); 
      _medicalViewer.Cells[1].Rows = 2; 
      _medicalViewer.Cells[1].Columns = 2; 
      _medicalViewer.Cells[1].Frozen = false; 
      _medicalViewer.Cells[1].DisplayRulers = MedicalViewerRulers.Both; 
      _medicalViewer.Cells[1].ApplyOnIndividualSubCell = false; 
      _medicalViewer.Cells[1].ApplyActionOnMove = true; 
      _medicalViewer.Cells[1].FitImageToCell = true; 
      _medicalViewer.Cells[1].Selected = true; 
      _medicalViewer.Cells[1].ShowTags = true; 
 
      RasterCodecs.Shutdown(); 
      Controls.Add(_medicalViewer); 
   } 
}

Remarks

The MedicalViewer is used to display graphics from a bitmap, metafile, icon, JPEG, GIF or PNG (or any other image file format supported by Leadtools) file. It provides support for displaying one or more images and for the real-time manipulation of one or more images. This control is available only in the Medical toolkits. For more information, refer to Document/Medical Edition Support and Licensing Requirements

This control is a high-level component for building medical display applications such as DICOM viewers, view stations, Teleradiology solutions, and high-end diagnostic workstations found in radiology and other medical specialty departments. When building a PACS for radiology, cardiology, mammography, ophthalmology, pathology, dermatology, dentistry or any other specialty, this control will eliminate project complexity and provide a solid, reliable foundation.

Typical applications that can be built using this control include:
  • High-end medical diagnostic workstations.
  • Medical review and quality assurance stations.
  • DICOM viewers.
  • Light-weight viewers that are typically distributed on a CD with patient images.
  • Web-based medical viewers.
Key Features:
  • Display medical grayscale and colored images, including MRI, CT, Digital X-Ray, and Ultrasound.
  • Adjust screen layout both manually and programmatically.
  • Display overlay information on images, with full control over display text and its positioning inside each window. Includes built-in overlays such as window center, window width values, and field of view.
  • Built-in image manipulation tools, including:
    • Window level (brightness and contrast).
    • Zooming or scaling an image.
    • Panning or moving an image.
    • Image magnification.
    • Single-key or single-click stacking or moving from one image to another in a series.
    • Different annotation objects, with the ability to convert them into a region of interest, or calibrate the annotation ruler.
    • Different ways of defining the region of interest.
  • Adjustable settings for each tool, such as:
    • Mouse button controls
    • Keyboard (hotkey) controls
    • Cursor display icon
    • Apply effects to a single image, or to all images in a series
    • Apply effects to a single series or to all series managed by the control
    • Apply effects programmatically or through user interaction.
  • Full control over display container properties, such as colors, cursors, and rulers.
  • Built-in adjustable ruler that scales to image DPI and zoom or scale factor.
  • Interpolated image display for higher quality.
For more information, refer to Applying Actions and Using the Image Viewer.

Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         System.Windows.Forms.Control
            Leadtools.MedicalViewer.MedicalViewer

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.MedicalViewer requires a Medical Imaging license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features