Fellow Oak DICOM
Search Results for

    Show / Hide Table of Contents

    Class DicomDatasetExtensions

    Inheritance
    System.Object
    DicomDatasetExtensions
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: FellowOakDicom.IO.Writer
    Assembly: fo-dicom.core.dll
    Syntax
    public static class DicomDatasetExtensions

    Methods

    RecalculateGroupLength(DicomDataset, UInt16, Boolean)

    Recalculates the group length element for the specified group. Removes the group length element if no elements exist for the specified group.

    Declaration
    public static void RecalculateGroupLength(this DicomDataset dataset, ushort group, bool createIfMissing = true)
    Parameters
    Type Name Description
    DicomDataset dataset

    DICOM dataset

    System.UInt16 group

    DICOM tag group

    System.Boolean createIfMissing

    If set to true, the group length element will be created if missing. If set to false, the group length will only be calculated if the group length element exists.

    Remarks

    For most use cases, this method will be called by the library as needed and will not need to be called by the user.

    RecalculateGroupLengths(DicomDataset, Boolean)

    Recalculates the group lengths for all groups in the dataset. Removes any group lengths for groups with out elements.

    Declaration
    public static void RecalculateGroupLengths(this DicomDataset dataset, bool createIfMissing = true)
    Parameters
    Type Name Description
    DicomDataset dataset

    DICOM dataset

    System.Boolean createIfMissing

    If set to true, group length elements will be created if missing. If set to false, only groups with existing group lengths will be recalculated.

    Remarks

    For most use cases, this method will be called by the library as needed and will not need to be called by the user.

    RemoveGroupLengths(DicomDataset, Boolean)

    Removes group length elements from the DICOM dataset.

    Declaration
    public static void RemoveGroupLengths(this DicomDataset dataset, bool firstLevelOnly = false)
    Parameters
    Type Name Description
    DicomDataset dataset

    DICOM dataset

    System.Boolean firstLevelOnly

    If set to true, group length elements will only be removed from the first level of the dataset. If set to false, group lengths will also be removed from sequence items.

    Remarks

    For most use cases, this method will be called by the library as needed and will not need to be called by the user.

    In This Article
    Back to top Copyright (c) 2012-2025 fo-dicom contributors