DicomObjects.NET10 Documentation
DicomObjects Namespace / DicomImage Class / SpacingInViewer Method
The Area for which the spacing should be calculated
The viewer for which the spacing applies
Example



In This Topic
    SpacingInViewer Method
    In This Topic
    This method returns the Pixel Spacing within the region specified by Area, in a particular viewer
    Syntax
    'Declaration
     
    
    Public Overridable Function SpacingInViewer( _
       ByVal Area As SkiaSharp.SKRectI, _
       ByVal Viewer As DicomViewer _
    ) As SkiaSharp.SKSize
    'Usage
     
    
    Dim instance As DicomImage
    Dim Area As SkiaSharp.SKRectI
    Dim Viewer As DicomViewer
    Dim value As SkiaSharp.SKSize
     
    value = instance.SpacingInViewer(Area, Viewer)
    public virtual SkiaSharp.SKSize SpacingInViewer( 
       SkiaSharp.SKRectI Area,
       DicomViewer Viewer
    )
    public:
    virtual SkiaSharp.SKSize SpacingInViewer( 
       SkiaSharp.SKRectI Area,
       DicomViewer^ Viewer
    ) 

    Parameters

    Area
    The Area for which the spacing should be calculated
    Viewer
    The viewer for which the spacing applies

    Return Value

    The pixel spacing of the requested area
    Remarks

    This method returns the Pixel Spacing within a Region of the DicomImage. Note, one Image may have multiple regions with different pixel spacing values, so this method may return different values for different inputs.

    Note that for non-3D images, this returns exactly the same value as Spacing(SKRectI), but that 3D images have scaling dependent on the viewer size, as autoscaling is used for such images.

    Example
    DicomImage image = new DicomImage("yuour_dicom_image.dcm");
    var imageWidth = image.Size.Width;
    var imageHeight = image.Size.Height;
    var spaceViewer = image.SpacingInViewer(new Rectangle(0, 0, imageWidth, imageHeight), Viewer); // Example value {Width = 0.714 Height = 0.714} mm
    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