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
datasetDicomDatasetwriteTagsAsKeywordsboolWhether to write the json keys as DICOM keywords instead of tags. This makes the json non-compliant to DICOM JSON.
formatIndentedboolGets or sets a value that defines whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.
numberSerializationModeNumberSerializationModeDefines how numbers should be serialized. Defaults to 'AsNumber', which will throw FormatException when a number is not parsable.
Returns
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
datasetIEnumerable<DicomDataset>writeTagsAsKeywordsboolWhether to write the json keys as DICOM keywords instead of tags. This makes the json non-compliant to DICOM JSON.
formatIndentedboolGets or sets a value that defines whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.
Returns
ConvertJsonToDicom(string, bool)
Converts a Json-String to a DicomDataset.
public static DicomDataset ConvertJsonToDicom(string json, bool autoValidate = true)
Parameters
jsonstringautoValidateboolWhether the content of DicomItems shall be validated as soon as they are added to the DicomDataset.
Returns
ConvertJsonToDicomArray(string)
public static DicomDataset[] ConvertJsonToDicomArray(string json)
Parameters
jsonstring