Gets or sets the value that determine whether to show the slab boundaries on the image.
public bool ShowSlabBoundaries {get; set;}Public Property ShowSlabBoundaries As Booleantrue to show the slab boundaries, false to hide the slab boundaries.
To update the slab values manually, the user will have to update the Leadtools.Medical3D.Medical3DObject.Slab property using the source Leadtools.Medical3D.Medical3DContainer.
Imports LeadtoolsImports Leadtools.DicomImports Leadtools.Medical3DImports Leadtools.CodecsImports Leadtools.MedicalViewerImports Leadtools.Annotations.CoreImports Leadtools.Annotations.DesignersImports Leadtools.ImageProcessing.CorePrivate Class MedicalViewerSlabForm : Inherits FormPrivate _medicalViewer As MedicalViewerPrivate _seriesManager As MedicalViewerSeriesManagerPrivate Sub MedicalViewerSlabForm_SizeChanged(ByVal sender As Object, ByVal e As EventArgs)_medicalViewer.Size = New Size(Me.ClientRectangle.Right, Me.ClientRectangle.Bottom)End SubPublic Sub New(ByVal output As MedicalViewerSeriesManager)Dim _codecs As RasterCodecs = New RasterCodecs()AddHandler SizeChanged, AddressOf MedicalViewerSlabForm_SizeChanged' Create the medical viewer and adjust the size and the location._medicalViewer = New MedicalViewer(2, 2)_medicalViewer.Location = New Point(0, 0)_medicalViewer.Size = New Size(Me.ClientRectangle.Right, Me.ClientRectangle.Bottom)_seriesManager = outputDim index As IntegerDim image As RasterImageDim count As Integer = output.Stacks(0).Items.CountDim codecsInformation As CodecsImageInfoDim AxialFrame As MedicalViewerMPRCell = New MedicalViewerMPRCell()Dim SagittalFrame As MedicalViewerMPRCell = New MedicalViewerMPRCell()Dim CoronalFrame As MedicalViewerMPRCell = New MedicalViewerMPRCell()codecsInformation = _codecs.GetInformation(CStr(output.Stacks(0).Items(0).Data), True)Dim width As Integer = codecsInformation.WidthDim height As Integer = codecsInformation.HeightDim depth As Integer = 50' A create on a 3D controlDim _medical3DControl As Medical3DControl = New Medical3DControl()_medical3DControl.ObjectsContainer.Objects.Add(New Medical3DObject())_medical3DControl.ObjectsContainer.Objects(0).MemoryEfficientInit(depth)index = 0Do While index < depthimage = _codecs.Load(CStr(output.Stacks(0).Items(index).Data), 0, CodecsLoadByteOrder.BgrOrGrayOrRomm, 1, 1)_medical3DControl.ObjectsContainer.Objects(0).MemoryEfficientSetFrame(image, index, True)index += 1LoopDim spearator As String = ("\")Dim test As String() = output.Stacks(0).Items(0).ImageOrientation.Split(spearator.ToCharArray())Dim orientation As Single() = New Single(5) {}Dim i As IntegerFor i = 0 To 5orientation(i) = CSng(Convert.ToDouble(test(i)))Next i_medical3DControl.ObjectsContainer.Objects(0).MemoryEfficientEnd(orientation, output.Stacks(0).PixelSpacing)' create axial frame.AxialFrame.ShowMPRCrossHair = TrueAxialFrame.DistinguishMPRByColor = TrueAxialFrame.ShowSlabBoundaries = TrueAxialFrame.SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame)AxialFrame.AddAction(MedicalViewerActionType.Stack)AxialFrame.SetAction(MedicalViewerActionType.Stack, MedicalViewerMouseButtons.Wheel, MedicalViewerActionFlags.Active)' create Sagittal frame.SagittalFrame.ShowMPRCrossHair = TrueSagittalFrame.DistinguishMPRByColor = TrueSagittalFrame.ShowSlabBoundaries = TrueSagittalFrame.SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame)SagittalFrame.AddAction(MedicalViewerActionType.Stack)SagittalFrame.SetAction(MedicalViewerActionType.Stack, MedicalViewerMouseButtons.Wheel, MedicalViewerActionFlags.Active)' create coronal frame.CoronalFrame.ShowMPRCrossHair = TrueCoronalFrame.DistinguishMPRByColor = TrueCoronalFrame.ShowSlabBoundaries = TrueCoronalFrame.SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame)CoronalFrame.AddAction(MedicalViewerActionType.Stack)CoronalFrame.SetAction(MedicalViewerActionType.Stack, MedicalViewerMouseButtons.Wheel, MedicalViewerActionFlags.Active)' attach the MPR cells to the 3D control._medical3DControl.AxialFrame = AxialFrame_medical3DControl.SagittalFrame = SagittalFrame_medical3DControl.CoronalFrame = CoronalFrame_medicalViewer.AllowMultipleSelection = False_medicalViewer.Cells.Add(_medical3DControl)_medicalViewer.Cells.Add(AxialFrame)_medicalViewer.Cells.Add(SagittalFrame)_medicalViewer.Cells.Add(CoronalFrame)_medical3DControl.ObjectsContainer.Objects(0).Slab.Enabled = True_medical3DControl.ObjectsContainer.Objects(0).Slab.SetValues(-1, 0.5F, -1, 0.5F, -0.5F, 0.5F)Controls.Add(_medicalViewer)_medicalViewer.Dock = DockStyle.FillEnd SubPrivate Sub cell_Data3DRequested(ByVal sender As Object, ByVal e As MedicalViewerData3DRequestedEventArgs)e.Succeed = Medical3DEngine.Provide3DInformation(e)End SubPrivate Sub cell_FramesRequested(ByVal sender As Object, ByVal e As MedicalViewerRequestedFramesInformationEventArgs)Dim cell As MedicalViewerMultiCell = CType(sender, MedicalViewerMultiCell)Dim _codecs As RasterCodecs = New RasterCodecs()Dim i As IntegerDim image As RasterImageDim fileName As StringIf e.RequestedFramesIndexes.Length > 0 ThenfileName = CStr(_seriesManager.Stacks(0).Items(e.RequestedFramesIndexes(0)).Data)image = _codecs.Load(fileName)ElseReturnEnd Ifi = 1Do While i < e.RequestedFramesIndexes.LengthfileName = CStr(_seriesManager.Stacks(0).Items(e.RequestedFramesIndexes(i)).Data)image.AddPage(_codecs.Load(fileName))i += 1Loopcell.SetRequestedImage(image, e.RequestedFramesIndexes, MedicalViewerSetImageOptions.Insert)End SubPublic ReadOnly Property Viewer() As MedicalViewerGetReturn _medicalViewerEnd GetEnd PropertyEnd ClassPrivate Function GetMedicalViewerSlabForm() As MedicalViewerSlabFormDim form As MedicalViewerSeriesManagerFrom = New MedicalViewerSeriesManagerFrom()Dim output As MedicalViewerSeriesManager = form.LoadJamesHead()Return New MedicalViewerSlabForm(output)End Function' This example changes the default window level value by decrease the width by 100. Then resets the images based on the new value.<TestMethod()> _Public Sub MedicalViewerSlabExample()Dim myForm As MedicalViewerSlabForm = GetMedicalViewerSlabForm()Dim medicalViewer As MedicalViewer = myForm.ViewermyForm.ShowDialog()End Sub
using Leadtools;using Leadtools.Dicom;using Leadtools.Medical3D;using Leadtools.Codecs;using Leadtools.MedicalViewer;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Core;using Leadtools.ImageProcessing.Color;using Leadtools.Annotations.Core;using Leadtools.Annotations.Designers;class MedicalViewerSlabForm : Form{private MedicalViewer _medicalViewer;private MedicalViewerSeriesManager _seriesManager;void MedicalViewerSlabForm_SizeChanged(object sender, EventArgs e){_medicalViewer.Size = new Size(this.ClientRectangle.Right, this.ClientRectangle.Bottom);}public MedicalViewerSlabForm(MedicalViewerSeriesManager output){RasterCodecs _codecs = new RasterCodecs();this.SizeChanged += new EventHandler(MedicalViewerSlabForm_SizeChanged);// Create the medical viewer and adjust the size and the location._medicalViewer = new MedicalViewer(2, 2);_medicalViewer.Location = new Point(0, 0);_medicalViewer.Size = new Size(this.ClientRectangle.Right, this.ClientRectangle.Bottom);_seriesManager = output;int index;RasterImage image;int count = output.Stacks[0].Items.Count;CodecsImageInfo codecsInformation;MedicalViewerMPRCell AxialFrame = new MedicalViewerMPRCell();MedicalViewerMPRCell SagittalFrame = new MedicalViewerMPRCell();MedicalViewerMPRCell CoronalFrame = new MedicalViewerMPRCell();codecsInformation = _codecs.GetInformation((string)output.Stacks[0].Items[0].Data, true);int width = codecsInformation.Width;int height = codecsInformation.Height;int depth = 50;// A create on a 3D controlMedical3DControl _medical3DControl = new Medical3DControl();_medical3DControl.ObjectsContainer.Objects.Add(new Medical3DObject());_medical3DControl.ObjectsContainer.Objects[0].MemoryEfficientInit(depth);for (index = 0; index < depth; index++){image = _codecs.Load((string)output.Stacks[0].Items[index].Data, 0, CodecsLoadByteOrder.BgrOrGrayOrRomm, 1, 1);_medical3DControl.ObjectsContainer.Objects[0].MemoryEfficientSetFrame(image, index, true);}string spearator = ("\\");string[] test = output.Stacks[0].Items[0].ImageOrientation.Split(spearator.ToCharArray());float[] orientation = new float[6];int i;for (i = 0; i < 6; i++){orientation[i] = (float)Convert.ToDouble(test[i]);}_medical3DControl.ObjectsContainer.Objects[0].MemoryEfficientEnd(orientation,output.Stacks[0].PixelSpacing);// create axial frame.AxialFrame.ShowMPRCrossHair = true;AxialFrame.DistinguishMPRByColor = true;AxialFrame.ShowSlabBoundaries = true;AxialFrame.SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame);AxialFrame.AddAction(MedicalViewerActionType.Stack);AxialFrame.SetAction(MedicalViewerActionType.Stack, MedicalViewerMouseButtons.Wheel, MedicalViewerActionFlags.Active);// create Sagittal frame.SagittalFrame.ShowMPRCrossHair = true;SagittalFrame.DistinguishMPRByColor = true;SagittalFrame.ShowSlabBoundaries = true;SagittalFrame.SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame);SagittalFrame.AddAction(MedicalViewerActionType.Stack);SagittalFrame.SetAction(MedicalViewerActionType.Stack, MedicalViewerMouseButtons.Wheel, MedicalViewerActionFlags.Active);// create coronal frame.CoronalFrame.ShowMPRCrossHair = true;CoronalFrame.DistinguishMPRByColor = true;CoronalFrame.ShowSlabBoundaries = true;CoronalFrame.SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame);CoronalFrame.AddAction(MedicalViewerActionType.Stack);CoronalFrame.SetAction(MedicalViewerActionType.Stack, MedicalViewerMouseButtons.Wheel, MedicalViewerActionFlags.Active);// attach the MPR cells to the 3D control._medical3DControl.AxialFrame = AxialFrame;_medical3DControl.SagittalFrame = SagittalFrame;_medical3DControl.CoronalFrame = CoronalFrame;_medicalViewer.AllowMultipleSelection = false;_medicalViewer.Cells.Add(_medical3DControl);_medicalViewer.Cells.Add(AxialFrame);_medicalViewer.Cells.Add(SagittalFrame);_medicalViewer.Cells.Add(CoronalFrame);_medical3DControl.ObjectsContainer.Objects[0].Slab.Enabled = true;_medical3DControl.ObjectsContainer.Objects[0].Slab.SetValues(-1, 0.5f, -1, 0.5f, -0.5f, 0.5f);Controls.Add(_medicalViewer);_medicalViewer.Dock = DockStyle.Fill;}void cell_Data3DRequested(object sender, MedicalViewerData3DRequestedEventArgs e){e.Succeed = Medical3DEngine.Provide3DInformation(e);}void cell_FramesRequested(object sender, MedicalViewerRequestedFramesInformationEventArgs e){MedicalViewerMultiCell cell = (MedicalViewerMultiCell)(sender);RasterCodecs _codecs = new RasterCodecs();int i;RasterImage image;string fileName;if (e.RequestedFramesIndexes.Length > 0){fileName = (string)(_seriesManager.Stacks[0].Items[e.RequestedFramesIndexes[0]].Data);image = _codecs.Load(fileName);}elsereturn;for (i = 1; i < e.RequestedFramesIndexes.Length; i++){fileName = (string)(_seriesManager.Stacks[0].Items[e.RequestedFramesIndexes[i]].Data);image.AddPage(_codecs.Load(fileName));}cell.SetRequestedImage(image, e.RequestedFramesIndexes, MedicalViewerSetImageOptions.Insert);}public MedicalViewer Viewer{get { return _medicalViewer; }}}MedicalViewerSlabForm GetMedicalViewerSlabForm(){MedicalViewerSeriesManagerFrom form = new MedicalViewerSeriesManagerFrom();MedicalViewerSeriesManager output = form.LoadJamesHead();return new MedicalViewerSlabForm(output);}// This example changes the default window level value by decrease the width by 100. Then resets the images based on the new value.public void MedicalViewerSlabExample(){MedicalViewerSlabForm myForm = GetMedicalViewerSlabForm();MedicalViewer medicalViewer = myForm.Viewer;myForm.ShowDialog();}
|
Products |
Support |
Feedback: ShowSlabBoundaries Property - Leadtools.MedicalViewer |
Introduction |
Help Version 19.0.2017.3.24
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.