public static RasterViewPerspective GetNewViewPerspective(
this DicomDataSet ds,
RasterViewPerspective currentViewPerspective,
OrientationConfiguration orientation
)
[ExtensionAttribute()]
public:
static RasterViewPerspective GetNewViewPerspective(
DicomDataSet^ ds,
RasterViewPerspective currentViewPerspective,
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 an 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;
using Leadtools.Codecs;
public void GetNewViewPerspectiveExample2()
{
DicomEngine.Startup();
string dicomFileCoronal = Path.Combine(LEAD_VARS.ImagesDir, "DICOM","image1.dcm");
DicomDataSet ds = new DicomDataSet();
ds.Load(dicomFileCoronal, DicomDataSetLoadFlags.None);
// Create a new coronal PlaneOrientation that corresponds to a horizontal flip
PlaneOrientation 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))
{
Console.WriteLine("Invalid PlaneOrientation for Coronal");
return;
}
// Create a new sagittal PlaneOrientation that corresponds to a Rotate90
PlaneOrientation poSagittal = new PlaneOrientation();
poSagittal.Name = "Sagittal";
poSagittal.Top = OrientationAxis.Anterior;
poSagittal.Right = OrientationAxis.Inferior;
poSagittal.Condition = new TagValueOrientationCondition(0, null);
if (!poSagittal.IsValid(Plane.Sagittal))
{
Console.WriteLine("Invalid PlaneOrientation for Sagittal");
return;
}
// Create a new Axial that corresponds to a Rotate180
PlaneOrientation 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))
{
Console.WriteLine("Invalid PlaneOrientation for Axial");
return;
}
// Setup the OrientationConfiguration
OrientationConfiguration oc = new OrientationConfiguration();
oc.Coronal.Add(poCoronal);
oc.Sagittal.Add(poSagittal);
oc.Axial.Add(poAxial);
if (!oc.IsValid())
{
Console.WriteLine("Invalid OrientationConfiguration");
return;
}
// Find the new view perspective
RasterViewPerspective newViewPerspective = ds.GetNewViewPerspective(RasterViewPerspective.TopLeft, oc);
// New view perspective should be BottomLeft
Console.WriteLine("newViewPerspective should be BottomLeft\nActual newViewPerspective is " + newViewPerspective.ToString());
DicomEngine.Shutdown();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document