DicomObjects Reference
DicomObjects Reference / DicomImage Object / SubImage Method
Top left corner of original image to use
Top left corner of original image to use
Size of final image
Size of final image
Magnification to apply before cropping to size given by XSize and YSize
The Frame to copy
In This Topic
    SubImage Method
    In This Topic
    Description
    Creates a copy of part or all of the image with controlled size
    Syntax
    Visual Basic
    Public Function SubImage( _
       ByVal XOffset As Long, _
       ByVal YOffset As Long, _
       ByVal XSize As Long, _
       ByVal YSize As Long, _
       ByVal Magnification As Single, _
       ByVal Frame As Long _
    ) As DicomImage
    Parameters
    XOffset
    Top left corner of original image to use
    YOffset
    Top left corner of original image to use
    XSize
    Size of final image
    YSize
    Size of final image
    Magnification
    Magnification to apply before cropping to size given by XSize and YSize
    Frame
    The Frame to copy
    Remarks

    Makes a derived image (of same basic DICOM type as the original) scaled and cropped as required.  Unlike PrinterImage, the pixel data is not modified or scaled, and XSize and YSize refer to the final image size, not the input (useful for making fixed size thumbnails etc.)

    If the original image is flipped and/or rotated, then the SubImage will be similarly modified, and the coordinates used for the offsets and sizes apply in the rotated/flipped coordinate space.  This makes it simple to select sub-images using a GUI, as the coordinates used for SubImage are compatible with those used for an DicomLabel with ScaleMode set to Image.

    See Also