DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomImage3D Class / Clip Method / Clip(DicomLabel,Size) Method
The label containing a rectangle or line used to define the cut planes
The size of the area in which the image is displayed
Example

In This Topic
    Clip(DicomLabel,Size) Method
    In This Topic
    Apply clip planes to the display volume
    Syntax
    'Declaration
     
    
    Public Overloads Sub Clip( _
       ByVal Label As DicomLabel, _
       ByVal DisplayArea As System.Drawing.Size _
    ) 
    public void Clip( 
       DicomLabel Label,
       System.Drawing.Size DisplayArea
    )

    Parameters

    Label
    The label containing a rectangle or line used to define the cut planes
    DisplayArea
    The size of the area in which the image is displayed
    Remarks

    1 plane (for a line) or 4 planes (for a rectangle) are generated, each of which is orthogonal to the current display plane, and each includes, at that plane, the line(s) of the label. These are added to the CutPlanes collection, and may therefore subsequently be removed form that collection if necessary. The overall effect then when this method is used is to leave the image displayed only on one side of the line, or within the rectangle.

    Example
    DicomImage image = new DicomImage("your_3D_dicom_image.dcm");
    DicomVolume volume = new DicomVolume(image);
                        
    RenderMode3D renderMode = RenderMode3D.VR;
    DicomImage3D image3D = new DicomImage3D(volume, renderMode);   
                
    Size displayArea = new Size(image3D.Size.Width, image3D.Size.Height);
    Rectangle clipRectangle = new Rectangle(displayArea.Width / 4, displayArea.Height / 4, displayArea.Width / 2, displayArea.Height / 2);
                        
    DicomLabel clippingLabel = new DicomLabel()
    {
        LabelType = LabelType.Rectangle, 
        Area = clipRectangle, 
        Pen = Pens.Red 
    }
                        
    image3D.Clip(clippingLabel, displayArea);
    Viewer.Images.Add(image3D);
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also