Fellow Oak DICOM
Search Results for

    Show / Hide Table of Contents

    Class DicomJson

    Inheritance
    System.Object
    DicomJson
    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.Serialization
    Assembly: fo-dicom.core.dll
    Syntax
    public static class DicomJson

    Methods

    ConvertDicomToJson(DicomDataset, Boolean, Boolean, NumberSerializationMode)

    Converts a DicomDataset to a Json-String.

    Declaration
    public static string ConvertDicomToJson(DicomDataset dataset, bool writeTagsAsKeywords = false, bool formatIndented = false, NumberSerializationMode numberSerializationMode = NumberSerializationMode.AsNumber)
    Parameters
    Type Name Description
    DicomDataset dataset
    System.Boolean writeTagsAsKeywords

    Whether to write the json keys as DICOM keywords instead of tags. This makes the json non-compliant to DICOM JSON.

    System.Boolean formatIndented

    Gets or sets a value that defines whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

    NumberSerializationMode numberSerializationMode

    Defines how numbers should be serialized. Defaults to 'AsNumber', which will throw FormatException when a number is not parsable.

    Returns
    Type Description
    System.String

    ConvertDicomToJson(IEnumerable<DicomDataset>, Boolean, Boolean)

    Converts an array or list of DicomDataset to a Json-String.

    Declaration
    public static string ConvertDicomToJson(IEnumerable<DicomDataset> dataset, bool writeTagsAsKeywords = false, bool formatIndented = false)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<DicomDataset> dataset
    System.Boolean writeTagsAsKeywords

    Whether to write the json keys as DICOM keywords instead of tags. This makes the json non-compliant to DICOM JSON.

    System.Boolean formatIndented

    Gets or sets a value that defines whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

    Returns
    Type Description
    System.String

    ConvertJsonToDicom(String, Boolean)

    Converts a Json-String to a DicomDataset.

    Declaration
    public static DicomDataset ConvertJsonToDicom(string json, bool autoValidate = true)
    Parameters
    Type Name Description
    System.String json
    System.Boolean autoValidate

    Whether the content of DicomItems shall be validated as soon as they are added to the DicomDataset.

    Returns
    Type Description
    DicomDataset

    ConvertJsonToDicomArray(String)

    Declaration
    public static DicomDataset[] ConvertJsonToDicomArray(string json)
    Parameters
    Type Name Description
    System.String json
    Returns
    Type Description
    DicomDataset[]
    In This Article
    Back to top Copyright (c) 2012-2025 fo-dicom contributors