public class DicomPresentationStateInformation : IDisposable @interface LTDicomPresentationStateInformation : NSObject public class DicomPresentationStateInformation public ref class DicomPresentationStateInformation : public System.IDisposable using Leadtools;using Leadtools.Dicom;public void DicomPresStateSample(){//Make sure to initialize the DICOM engine, this needs to be done only once//In the whole applicationDicomEngine.Startup();using (DicomDataSet dicomDataset = new DicomDataSet()){dicomDataset.Initialize(DicomClassType.GrayscaleSoftcopyPresentationState, DicomDataSetInitializeType.ExplicitVRLittleEndian);DicomPresentationStateInformation presentationStateInfo = new DicomPresentationStateInformation();presentationStateInfo.InstanceNumber = 1;presentationStateInfo.PresentationLabel = "LABEL";presentationStateInfo.PresentationDescription = "Description";presentationStateInfo.PresentationCreator = "Creator";DicomDateValue presentationCreationDate = new DicomDateValue();presentationCreationDate.Year = 2004;presentationCreationDate.Month = 1;presentationCreationDate.Day = 8;DicomTimeValue presentationCreationTime = new DicomTimeValue();presentationCreationTime.Hours = 2;presentationCreationTime.Minutes = 3;presentationCreationTime.Seconds = 5;presentationStateInfo.PresentationCreationDate = presentationCreationDate;presentationStateInfo.PresentationCreationTime = presentationCreationTime;dicomDataset.SetPresentationStateInformation(presentationStateInfo);DicomPresentationStateInformation presentationStateInfo1 = dicomDataset.GetPresentationStateInformation();Debug.Assert(presentationStateInfo1 != null);Debug.Assert(presentationStateInfo1.InstanceNumber == 1);//RemovePresStateImageRefBySOPInstance can be used to remove indivual referened imagesdicomDataset.RemoveAllPresentationStateImageReferences();Debug.Assert(dicomDataset.GetPresentationStateImageReferenceCount(null) == 0);// We can also load the dataset first and then call AddPresStateImageRefByDSdicomDataset.AddPresentationStateImageReference(Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "IMAGE3.dcm"), null, 0);// We can also add the presentation state using a streamusing (FileStream stream = new FileStream(Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "image3.dcm"), FileMode.Open)){dicomDataset.AddPresentationStateImageReference(stream, null, 0);}//We can also use FindNextPresStateRefSeriesItem to iterate through all itemsDicomElement item = dicomDataset.FindFirstPresentationStateReferencedSeriesItem();string imageRefSOPInstanceUID = dicomDataset.GetPresentationStateImageReferenceSOPInstance(item, 0);Debug.Assert(imageRefSOPInstanceUID != null);DicomElement item1 = dicomDataset.GetPresentationStateImageReference(imageRefSOPInstanceUID);Debug.Assert(item1 != null);dicomDataset.Save(Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "PresentationState.dcm"), DicomDataSetSaveFlags.None);}DicomEngine.Shutdown();}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";}
DicomPresentationStateInformation Members
SetPresentationStateInformation Method
AddPresentationStateImageReference(String,Int32[],Int32) Method
AddPresentationStateImageReference(DicomDataSet,Int32[],Int32) Method
FindFirstPresentationStateReferencedSeriesItem Method
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
