Gets a new RasterViewPerspective that results from applying a OrientationConfiguration to a given RasterViewPerspective.
[ExtensionAttribute()]public static Leadtools.RasterViewPerspective GetNewViewPerspective(Leadtools.Dicom.DicomDataSet ds,Leadtools.RasterViewPerspective currentViewPerspective,Leadtools.Dicom.Common.Datatypes.OrientationConfiguration orientation)
<ExtensionAttribute()>Public Overloads Shared Function GetNewViewPerspective( _ByVal ds As Leadtools.Dicom.DicomDataSet, _ByVal currentViewPerspective As Leadtools.RasterViewPerspective, _ByVal orientation As Leadtools.Dicom.Common.Datatypes.OrientationConfiguration _) As Leadtools.RasterViewPerspective
[ExtensionAttribute()]public:static Leadtools.RasterViewPerspective GetNewViewPerspective(Leadtools.Dicom.DicomDataSet^ ds,Leadtools.RasterViewPerspective currentViewPerspective,Leadtools.Dicom.Common.Datatypes.OrientationConfiguration^ orientation)
ds
The DicomDataSet that contains the image orientation vectors
currentViewPerspective
The input RasterViewPerspective to which the PlaneOrientation will be applied.
orientation
An OrientationConfiguration that will be applied to the current view perspective.
This overload gets the image orientation vectors from the ds.
The input view perspective is defined by two values: the original RasterViewPerspective, and a row and column orientation vector (which are read from the ds by searching for the DicomElement that has a tag of ImageOrientationPatient which contains the orientation vectors.). This method returns the new RasterViewPerspective that results from applying a OrientationConfiguration to the input view perspective. Note that the orientation contains three lists of conditions (one for each 3D axis) that can be applied to the image contained in the ds if the condition is met.
This example does the following:
using Leadtools.Dicom;using Leadtools.Dicom.Common;using Leadtools.Dicom.Common.Extensions;using Leadtools;using Leadtools.Dicom.Common.Linq.BasicDirectory;using Leadtools.Dicom.Common.DataTypes;public void GetNewViewPerspectiveExample2(){DicomEngine.Startup();string dicomFileCoronal = Path.Combine(LEAD_VARS.ImagesDir, "image1.dcm");DicomDataSet ds = new DicomDataSet();ds.Load(dicomFileCoronal, DicomDataSetLoadFlags.None);// Create a new coronal PlaneOrientation that corresponds to a horizontal flipPlaneOrientation poCoronal = new PlaneOrientation();poCoronal.Name = "Coronal or Frontal";poCoronal.Top = OrientationAxis.Inferior;poCoronal.Right = OrientationAxis.Right;poCoronal.Condition = new TagValueOrientationCondition(DicomTag.ImageOrientationPatient, null);if (!poCoronal.IsValid(Plane.Coronal)){MessageBox.Show("Invalid PlaneOrientation for Coronal");return;}// Create a new sagittal PlaneOrientation that corresponds to a Rotate90PlaneOrientation poSaggital = new PlaneOrientation();poSaggital.Name = "Saggital";poSaggital.Top = OrientationAxis.Anterior;poSaggital.Right = OrientationAxis.Inferior;poSaggital.Condition = new TagValueOrientationCondition(0, null);if (!poSaggital.IsValid(Plane.Sagittal)){MessageBox.Show("Invalid PlaneOrientation for Sagittal");return;}// Create a new Axial that corresponds to a Rotate180PlaneOrientation poAxial = new PlaneOrientation();poAxial.Name = "Axial";poAxial.Top = OrientationAxis.Posterior;poAxial.Right = OrientationAxis.Left;poAxial.Condition = new TagValueOrientationCondition(0, null);if (!poAxial.IsValid(Plane.Axial)){MessageBox.Show("Invalid PlaneOrientation for Axial");return;}// Setup the OrientationConfigurationOrientationConfiguration oc = new OrientationConfiguration();oc.Coronal.Add(poCoronal);oc.Sagittal.Add(poSaggital);oc.Axial.Add(poAxial);if (!oc.IsValid()){MessageBox.Show("Invalid OrientationConfiguration");return;}// Find the new view perspectiveRasterViewPerspective newViewPerspective = ds.GetNewViewPerspective(RasterViewPerspective.TopLeft, oc);// New view perspective should be BottomLeftMessageBox.Show("newViewPerspective should be BottomLeft\nActual newViewPerspective is " + newViewPerspective.ToString());DicomEngine.Shutdown();}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports Leadtools.DicomImports Leadtools.Dicom.CommonImports Leadtools.Dicom.Common.ExtensionsImports Leadtools.Dicom.Common.LinqImports Leadtools.Dicom.Common.Linq.BasicDirectoryImports LeadtoolsImports Leadtools.Dicom.Common.DataTypesPublic Sub GetNewViewPerspectiveExample2()Dim dicomFileCoronal As String = Path.Combine(LEAD_VARS.ImagesDir, "image3.dcm")Dim ds As New DicomDataSet()ds.Load(dicomFileCoronal, DicomDataSetLoadFlags.None)' Create a new coronal PlaneOrientation that corresponds to a horizontal flipDim poCoronal As New PlaneOrientation()poCoronal.Name = "Coronal or Frontal"poCoronal.Top = OrientationAxis.InferiorpoCoronal.Right = OrientationAxis.RightpoCoronal.Condition = New TagValueOrientationCondition(DicomTag.ImageOrientationPatient, Nothing)If (Not poCoronal.IsValid(Plane.Coronal)) ThenMessageBox.Show("Invalid PlaneOrientation for Coronal")ReturnEnd If' Create a new sagittal PlaneOrientation that corresponds to a Rotate90Dim poSaggital As New PlaneOrientation()poSaggital.Name = "Saggital"poSaggital.Top = OrientationAxis.AnteriorpoSaggital.Right = OrientationAxis.InferiorpoSaggital.Condition = New TagValueOrientationCondition(0, Nothing)If (Not poSaggital.IsValid(Plane.Sagittal)) ThenMessageBox.Show("Invalid PlaneOrientation for Sagittal")ReturnEnd If' Create a new Axial that corresponds to a Rotate180Dim poAxial As New PlaneOrientation()poAxial.Name = "Axial"poAxial.Top = OrientationAxis.PosteriorpoAxial.Right = OrientationAxis.LeftpoAxial.Condition = New TagValueOrientationCondition(0, Nothing)If (Not poAxial.IsValid(Plane.Axial)) ThenMessageBox.Show("Invalid PlaneOrientation for Axial")ReturnEnd If' Set up the OrientationConfigurationDim oc As New OrientationConfiguration()oc.Coronal.Add(poCoronal)oc.Sagittal.Add(poSaggital)oc.Axial.Add(poAxial)If (Not oc.IsValid()) ThenMessageBox.Show("Invalid OrientationConfiguration")ReturnEnd If' Find the new view perspectiveDim newViewPerspective As RasterViewPerspective = ds.GetNewViewPerspective(RasterViewPerspective.TopLeft, oc)' New view perspective should be BottomLeftMessageBox.Show("newViewPerspective should be BottomLeft" & Constants.vbLf & "Actual newViewPerspective is " & newViewPerspective.ToString())End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
|
Products |
Support |
Feedback: GetNewViewPerspective(DicomDataSet,RasterViewPerspective,OrientationConfiguration) Method - Leadtools.Dicom.Common |
Introduction |
Help Version 19.0.2017.6.23
|

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.