DicomObjects.NET8 Documentation
DicomObjects Namespace / DicomImage Class / CurrentToPresentationState Method

The image size in pixel which is to be rendered

Controls whether additional private elements are included.

Example



In This Topic
    CurrentToPresentationState Method
    In This Topic
    Encapsulate current display properties into a DICOM GreyScale Presentation State object
    Syntax
    'Declaration
     
    
    Public Sub CurrentToPresentationState( _
       ByVal DisplaySize As SkiaSharp.SKSizeI, _
       ByVal usePrivate As Boolean _
    ) 
    'Usage
     
    
    Dim instance As DicomImage
    Dim DisplaySize As SkiaSharp.SKSizeI
    Dim usePrivate As Boolean
     
    instance.CurrentToPresentationState(DisplaySize, usePrivate)
    public void CurrentToPresentationState( 
       SkiaSharp.SKSizeI DisplaySize,
       bool usePrivate
    )
    public:
    void CurrentToPresentationState( 
       SkiaSharp.SKSizeI DisplaySize,
       bool usePrivate
    ) 

    Parameters

    DisplaySize

    The image size in pixel which is to be rendered

    usePrivate

    Controls whether additional private elements are included.

    Remarks

    The presentation state created is immediately used as the image�s PresentationState property, so after this call, the display should not be visibly altered, though small changes may be seen due to the reduced flexibility of colours etc. in DICOM presentation states compared with DicomObjects' DicomLabel objects.

    The properties encapsulated into the presentation state include:

    There are several properties of DicomLabel objects which do not have official DICOM equivalents, such as font details,RotationMode and AutoSizeMode. If usePrivate is true, then private attribute in the range 6E15,7Axx are added to the presentation state to store them, but if usePrivate is false, then these properties must be discarded.

    This method does have some limitations, and the following objects/properties are not currently converted:

    These issues will be addressed in a future version of DicomObjects
    Example
    var width = Convert.ToUInt16(Viewer.CurrentImage.DataSet[Keyword.Columns].Value);
    var height = Convert.ToUInt16(Viewer.CurrentImage.DataSet[Keyword.Rows].Value);
    Size size = new Size(width, height);
    bool usePrivate = true;
                
    // After applying display changes (zoom, windowing, scrolling etc.), save presentation state.
    Viewer.CurrentImage.CurrentToPresentationState(size, usePrivate);
    Viewer.CurrentImage.PresentationState.Write("Output_PresentationState.dcm", TransferSyntaxes.ExplicitVRLittleEndian);
                
    // Example: Applying the presentation state
    DicomDataSet ps = new DicomDataSet("Output_PresentationState.dcm");
    Viewer.CurrentImage.PresentationState = ps;
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also