Leadtools.MedicalViewer Requires Medical Imaging license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
DeleteTag(Int32,MedicalViewerTagAlignment) Method
See Also  Example
Leadtools.MedicalViewer Namespace > MedicalViewerCell Class > DeleteTag Method : DeleteTag(Int32,MedicalViewerTagAlignment) Method



row
The line at which the overlay text is placed.
alignment
The overlay text alignment.
Deletes the tag (overlay text) of a cell.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub DeleteTag( _
   ByVal row As Integer, _
   ByVal alignment As MedicalViewerTagAlignment _
) 
Visual Basic (Usage)Copy Code
Dim instance As MedicalViewerCell
Dim row As Integer
Dim alignment As MedicalViewerTagAlignment
 
instance.DeleteTag(row, alignment)
C# 
public void DeleteTag( 
   int row,
   MedicalViewerTagAlignment alignment
)
C++/CLI 
public:
void DeleteTag( 
   int row,
   MedicalViewerTagAlignment alignment
) 

Parameters

row
The line at which the overlay text is placed.
alignment
The overlay text alignment.

Example

Visual BasicCopy Code
Private Class MedicalViewerForm : Inherits Form
   Private _medicalViewer As MedicalViewer
   Private applyEffects As Button
   Private Sub MedicalViewerForm_SizeChanged(ByVal sender As Object, ByVal e As EventArgs)
      _medicalViewer.Size = New Size(Me.ClientRectangle.Right - 30, Me.ClientRectangle.Bottom)
   End Sub

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

      AddHandler SizeChanged, AddressOf MedicalViewerForm_SizeChanged

      ' Create the medical viewer and adjust the size and the location.
      _medicalViewer = New MedicalViewer(1, 2)
      _medicalViewer.Location = New Point(30, 0)
      _medicalViewer.Size = New Size(Me.ClientRectangle.Right - 30, 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.Alpha)
      _medicalViewer.AddAction(MedicalViewerActionType.Offset)

      ' 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.Alpha, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active Or MedicalViewerActionFlags.RealTime)
      _medicalViewer.SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active Or MedicalViewerActionFlags.RealTime)

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

      ' 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)


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

      ' 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)

      RasterCodecs.Shutdown()

      applyEffects = New Button()
      applyEffects.Location = New Point(0, 0)
      applyEffects.Size = New Size(30, 15)
      applyEffects.Text = "Apply Effects"
      AddHandler applyEffects.Click, AddressOf applyEffects_Click

      Controls.Add(_medicalViewer)
      Controls.Add(applyEffects)
   End Sub

   Private Sub applyEffects_Click(ByVal sender As Object, ByVal e As EventArgs)
      Dim medicalViewer As MedicalViewer = CType(_medicalViewer, MedicalViewer)

      Dim result As System.Windows.Forms.DialogResult = MessageBox.Show("This demo will do some effects on the Medical viewer, Do you want to use the begin and update update?", "Begin Update And End Update Demo", MessageBoxButtons.YesNo)

      If result = System.Windows.Forms.DialogResult.Yes Then
         medicalViewer.BeginUpdate()
      End If

      medicalViewer.Cells(0).SetTag(8, 0, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "Sub Cell Tag 1")
      medicalViewer.Cells(0).SetTag(0, 8, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "Sub Cell Tag 2")
      medicalViewer.Cells(1).SetTag(1, 9, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "Sub Cell Tag 3")
      medicalViewer.Cells(1).SetTag(2, 10, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "Sub Cell Tag 4")
      medicalViewer.Cells(1).SetTag(3, 11, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "Sub Cell Tag 5")


      medicalViewer.Cells(0).Rows = 3
      medicalViewer.Cells(0).Columns = 3
      medicalViewer.Cells(0).FitImageToCell = False



      Dim tagInformation As MedicalViewerTagInformation = New MedicalViewerTagInformation()

      tagInformation.Alignment = MedicalViewerTagAlignment.BottomLeft
      tagInformation.Position = 3
      tagInformation.Text = "Edit Text 1"


      medicalViewer.Cells(0).EditTag(8, 0, MedicalViewerTagAlignment.TopLeft, tagInformation)


      tagInformation = New MedicalViewerTagInformation()
      tagInformation.Type = MedicalViewerTagType.Scale

      medicalViewer.Cells(0).EditTag(8, 0, MedicalViewerTagAlignment.BottomLeft, tagInformation)


      medicalViewer.Cells(0).DeleteTag(0, 8, MedicalViewerTagAlignment.TopLeft)

      ' Shift the second row, one row down
      tagInformation = medicalViewer.Cells(0).GetTag(2, 10, MedicalViewerTagAlignment.TopLeft)

      tagInformation.Position += 1

      medicalViewer.Cells(0).EditTag(2, 10, MedicalViewerTagAlignment.TopLeft, tagInformation)

      ' Shift the second row, one row down
      tagInformation = medicalViewer.Cells(0).GetTag(2, MedicalViewerTagAlignment.TopLeft)

      tagInformation.Text = "Edited sub-cell Tag1"
      medicalViewer.Cells(0).EditTag(2, MedicalViewerTagAlignment.TopLeft, tagInformation)

      medicalViewer.Cells(0).DeleteTag(4, MedicalViewerTagAlignment.TopLeft)

      Dim windowLevelProperties As MedicalViewerWindowLevel = CType(medicalViewer.GetActionProperties(MedicalViewerActionType.WindowLevel, 0, 0), MedicalViewerWindowLevel)

      windowLevelProperties.Width = 20
      windowLevelProperties.Center = 50

      medicalViewer.SetActionProperties(MedicalViewerActionType.WindowLevel, windowLevelProperties)


      Dim scale As Double = medicalViewer.Cells(0).GetScale(0)

      scale *= 2

      medicalViewer.Cells(0).SetScale(-1, scale)

      medicalViewer.Cells(1).SetScale(0, scale)

      Dim scaleMode As MedicalViewerScaleMode = medicalViewer.Cells(0).GetScaleMode(0)

      If scaleMode = Leadtools.MedicalViewer.MedicalViewerScaleMode.Normal Then
         scaleMode = MedicalViewerScaleMode.Fit
      Else
         scaleMode = MedicalViewerScaleMode.Normal
      End If

      medicalViewer.Cells(0).SetScaleMode(scaleMode)

      If result = System.Windows.Forms.DialogResult.Yes Then
         medicalViewer.EndUpdate()
      End If

   End Sub

   Public ReadOnly Property Viewer() As MedicalViewer
      Get
         Return _medicalViewer
      End Get
   End Property
End Class

Private Function GetMedicalControl() As MedicalViewerForm
   Return New MedicalViewerForm()
End Function

' This example creates a medical viewer control and two cells. when you click on the button it will ask you whether to apply some effects on the cell with or without using BeginUpdate/EndUpdate. Run this sample twice and see the difference
<Test> _
Public Sub MedicalViewerTagInformationExample()
   Dim myForm As MedicalViewerForm = GetMedicalControl()
   Dim medicalViewer As MedicalViewer = myForm.Viewer

   myForm.ShowDialog()
End Sub
C#Copy Code
class MedicalViewerForm : Form 

   private MedicalViewer _medicalViewer; 
   private Button applyEffects; 
   void MedicalViewerForm_SizeChanged(object sender, EventArgs e) 
   { 
      _medicalViewer.Size = new Size(this.ClientRectangle.Right - 30, this.ClientRectangle.Bottom); 
   } 
 
   public MedicalViewerForm() 
   { 
      RasterCodecs.Startup(); 
      RasterCodecs _codecs = new RasterCodecs(); 
      RasterImage _image; 
 
      this.SizeChanged += new EventHandler(MedicalViewerForm_SizeChanged); 
 
      // Create the medical viewer and adjust the size and the location. 
      _medicalViewer = new MedicalViewer(1, 2); 
      _medicalViewer.Location = new Point(30, 0); 
      _medicalViewer.Size = new Size(this.ClientRectangle.Right - 30, 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.Alpha); 
      _medicalViewer.AddAction(MedicalViewerActionType.Offset); 
 
      // 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.Alpha, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active | MedicalViewerActionFlags.RealTime); 
      _medicalViewer.SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active | MedicalViewerActionFlags.RealTime); 
 
      // Load an image and then add it to the control. 
      _image = _codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "xa.dcm"); 
      _medicalViewer.Cells.Add(new MedicalViewerCell(_image, true, 1, 1)); 
 
      // 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); 
 
 
      // Load another image and then add it to the control. 
      _image = _codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "mr.dcm"); 
      _medicalViewer.Cells.Add(new MedicalViewerCell(_image, true, 2, 2)); 
 
      // 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); 
 
      RasterCodecs.Shutdown(); 
 
      applyEffects = new Button(); 
      applyEffects.Location = new Point(0, 0); 
      applyEffects.Size = new Size(30, 15); 
      applyEffects.Text = "Apply Effects"; 
      applyEffects.Click += new EventHandler(applyEffects_Click); 
 
      Controls.Add(_medicalViewer); 
      Controls.Add(applyEffects); 
   } 
 
   void applyEffects_Click(object sender, EventArgs e) 
   { 
      MedicalViewer medicalViewer = (MedicalViewer)_medicalViewer; 
 
      DialogResult result = MessageBox.Show(@"This demo will do some effects on the Medical viewer, Do you want to use the begin and update update?", "Begin Update And End Update Demo", MessageBoxButtons.YesNo); 
 
      if (result == DialogResult.Yes) 
         medicalViewer.BeginUpdate(); 
 
      medicalViewer.Cells[0].SetTag( 8, 0,  MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "Sub Cell Tag 1"); 
      medicalViewer.Cells[0].SetTag( 0, 8,  MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "Sub Cell Tag 2"); 
      medicalViewer.Cells[1].SetTag( 1, 9,  MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "Sub Cell Tag 3"); 
      medicalViewer.Cells[1].SetTag( 2, 10, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "Sub Cell Tag 4"); 
      medicalViewer.Cells[1].SetTag( 3, 11, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData, "Sub Cell Tag 5"); 
 
 
      medicalViewer.Cells[0].Rows = 3; 
      medicalViewer.Cells[0].Columns = 3; 
      medicalViewer.Cells[0].FitImageToCell = false; 
 
 
 
      MedicalViewerTagInformation tagInformation = new MedicalViewerTagInformation(); 
 
      tagInformation.Alignment = MedicalViewerTagAlignment.BottomLeft; 
      tagInformation.Position = 3; 
      tagInformation.Text = "Edit Text 1"; 
 
 
      medicalViewer.Cells[0].EditTag(8, 0, MedicalViewerTagAlignment.TopLeft, tagInformation); 
 
 
      tagInformation = new MedicalViewerTagInformation(); 
      tagInformation.Type = MedicalViewerTagType.Scale; 
 
      medicalViewer.Cells[0].EditTag(8, 0, MedicalViewerTagAlignment.BottomLeft, tagInformation); 
 
 
      medicalViewer.Cells[0].DeleteTag(0, 8, MedicalViewerTagAlignment.TopLeft); 
 
      // Shift the second row, one row down 
      tagInformation = medicalViewer.Cells[0].GetTag(2, 10, MedicalViewerTagAlignment.TopLeft); 
 
      tagInformation.Position += 1; 
 
      medicalViewer.Cells[0].EditTag(2, 10, MedicalViewerTagAlignment.TopLeft, tagInformation); 
 
      // Shift the second row, one row down 
      tagInformation = medicalViewer.Cells[0].GetTag(2, MedicalViewerTagAlignment.TopLeft); 
 
      tagInformation.Text = "Edited sub-cell Tag1"; 
      medicalViewer.Cells[0].EditTag(2, MedicalViewerTagAlignment.TopLeft, tagInformation); 
 
      medicalViewer.Cells[0].DeleteTag(4, MedicalViewerTagAlignment.TopLeft); 
 
      MedicalViewerWindowLevel windowLevelProperties = (MedicalViewerWindowLevel)medicalViewer.GetActionProperties(MedicalViewerActionType.WindowLevel, 0, 0); 
 
      windowLevelProperties.Width = 20; 
      windowLevelProperties.Center = 50; 
 
      medicalViewer.SetActionProperties(MedicalViewerActionType.WindowLevel, windowLevelProperties); 
 
 
      double scale = medicalViewer.Cells[0].GetScale(0); 
 
      scale *= 2; 
 
      medicalViewer.Cells[0].SetScale(-1, scale); 
 
      medicalViewer.Cells[1].SetScale(0, scale); 
 
      MedicalViewerScaleMode scaleMode = medicalViewer.Cells[0].GetScaleMode(0); 
 
      if (scaleMode == MedicalViewerScaleMode.Normal) 
         scaleMode = MedicalViewerScaleMode.Fit; 
      else 
         scaleMode = MedicalViewerScaleMode.Normal; 
 
      medicalViewer.Cells[0].SetScaleMode(scaleMode); 
 
      if (result == DialogResult.Yes) 
         medicalViewer.EndUpdate(); 
 
   } 
 
   public MedicalViewer Viewer 
   { 
      get { return _medicalViewer; } 
   } 

 
MedicalViewerForm GetMedicalControl() 

   return new MedicalViewerForm(); 

 
// This example creates a medical viewer control and two cells. when you click on the button it will ask you whether to apply some effects on the cell with or without using BeginUpdate/EndUpdate. Run this sample twice and see the difference 
 
public void MedicalViewerTagInformationExample() 

   MedicalViewerForm myForm = GetMedicalControl(); 
   MedicalViewer medicalViewer = myForm.Viewer; 
 
   myForm.ShowDialog(); 
}

Remarks

  • This method will delete the cell tag. The cell tag is a tag that appears on all of the cell frames. To delete the sub-cell the tag use the DeleteTag method.
  • For more information, refer to Image Viewer Cells.

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