Table of Contents

Class DicomJson

Namespace
FellowOakDicom.Serialization
Assembly
fo-dicom.core.dll
public static class DicomJson
Inheritance
DicomJson
Inherited Members

Methods

ConvertDicomToJson(DicomDataset, bool, bool, NumberSerializationMode)

Converts a DicomDataset to a Json-String.

public static string ConvertDicomToJson(DicomDataset dataset, bool writeTagsAsKeywords = false, bool formatIndented = false, NumberSerializationMode numberSerializationMode = NumberSerializationMode.AsNumber)

Parameters

dataset DicomDataset
writeTagsAsKeywords bool

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

formatIndented bool

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

string

ConvertDicomToJson(IEnumerable<DicomDataset>, bool, bool)

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

public static string ConvertDicomToJson(IEnumerable<DicomDataset> dataset, bool writeTagsAsKeywords = false, bool formatIndented = false)

Parameters

dataset IEnumerable<DicomDataset>
writeTagsAsKeywords bool

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

formatIndented bool

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

Returns

string

ConvertJsonToDicom(string, bool)

Converts a Json-String to a DicomDataset.

public static DicomDataset ConvertJsonToDicom(string json, bool autoValidate = true)

Parameters

json string
autoValidate bool

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

Returns

DicomDataset

ConvertJsonToDicomArray(string)

public static DicomDataset[] ConvertJsonToDicomArray(string json)

Parameters

json string

Returns

DicomDataset[]