ImageGear for .NET
LoadPresState Method
See Also  Example Send Feedback
ImageGear21.Formats.Dicom Assembly > ImageGear.Formats.DICOM Namespace > ImGearDICOM Class : LoadPresState Method




stream
Stream, containing presentation state object.
page
Page to apply Presentation State to.
pageDisplay
PageDisplay to apply Presentation State to.
options
Options structure, tells which settings need to be applied.

Glossary Item Box

Loads Presentation State object and applies it to an image.

Syntax

 
Visual Basic
C#
Managed Extensions for C++
C++/CLI
 
 

Parameters

stream
Stream, containing presentation state object.
page
Page to apply Presentation State to.
pageDisplay
PageDisplay to apply Presentation State to.
options
Options structure, tells which settings need to be applied.

Return Value

New instance of ImageGear.Core.ImGearMetadataHead class object, containing metadata loaded from the Presentation State object.

Remarks

This method loads Presentation State object from a stream and applies settings, found in this object, to the page and to the pageDisplay. Specifically:
  • Adjusts page's ImGearDICOMDisplaySettings class member using VOI, Modality and Presentation LUTs, found in the Presentation State DataSet.
  • Sets image rectangle and orientation of the pageDisplay;
  • Adds annotation objects to the pageDisplay.

All previous settings and annotations of the page and pageDisplay are discarded.

This method also returns all metadata found in the Presentation State object.

Example

C#Copy Code
ImGearMetadataHead presStateOrigMetadata;
using (FileStream fileContent = new FileStream(fileName, FileMode.Open))
{
    ImGearPresStateOptions opts = new ImGearPresStateOptions();
    presStateOrigMetadata =
        ImGearDICOM.LoadPresState(fileContent, (ImGearRasterPage)igPage, igPageView.Display, opts);
}
Visual BasicCopy Code
Dim presStateOrigMetadata As ImGearMetadataHead
Using fileContent = New FileStream(fileName, FileMode.Open)
    Dim opts As ImGearPresStateOptions = New ImGearPresStateOptions()
    presStateOrigMetadata = ImGearDICOM.LoadPresState(fileContent, igPage, igPageView.Display, opts)
End Using

See Also

©2013. Accusoft Corporation. All Rights Reserved.