Class DicomJsonSerializer

Class DicomJsonSerializer

Namespace: Aspose.Medical.Dicom.Serialization
Assembly: Aspose.Medical.dll (25.11.0)

Provides functionality to serialize DICOM objects to JSON and to deserialize JSON into DICOM objects.

public static class DicomJsonSerializer

Inheritance

object DicomJsonSerializer

Inherited Members

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Methods

Deserialize(ReadOnlySpan<char>, DicomJsonSerializerOptions?, bool)

Parses the text representing a single JSON value into an instance of the Aspose.Medical.Dicom.Dataset.

public static Dataset? Deserialize(ReadOnlySpan<char> json, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

json ReadOnlySpan < char &gt;

The JSON text to parse.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

Dataset ?

The Aspose.Medical.Dicom.Dataset or null.

Deserialize(Stream, DicomJsonSerializerOptions?, bool)

Reads the UTF-8 encoded text representing a single JSON value into a Aspose.Medical.Dicom.Dataset.

public static Dataset? Deserialize(Stream utf8Json, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

JSON data to parse.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

Dataset ?

The Aspose.Medical.Dicom.Dataset or null.

DeserializeAsync(Stream, DicomJsonSerializerOptions?, bool)

Asynchronously reads the UTF-8 encoded text representing a single JSON value into a Aspose.Medical.Dicom.Dataset.

public static ValueTask<dataset?> DeserializeAsync(Stream utf8Json, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

JSON data to parse.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

ValueTask < Dataset ?&gt;

The Aspose.Medical.Dicom.Dataset or null.

DeserializeFile(ReadOnlySpan<char>, DicomJsonSerializerOptions?, bool)

Parses the text representing a single JSON value into an instance of the Aspose.Medical.Dicom.DicomFile.

public static DicomFile? DeserializeFile(ReadOnlySpan<char> json, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

json ReadOnlySpan < char &gt;

The JSON text to parse.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

DicomFile ?

The Aspose.Medical.Dicom.DicomFile or null.

DeserializeFile(Stream, DicomJsonSerializerOptions?, bool)

Reads the UTF-8 encoded text representing a single JSON value into a Aspose.Medical.Dicom.DicomFile.

public static DicomFile? DeserializeFile(Stream utf8Json, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

JSON data to parse.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

DicomFile ?

The Aspose.Medical.Dicom.DicomFile or null.

DeserializeFileAsync(Stream, DicomJsonSerializerOptions?, bool)

Asynchronously reads the UTF-8 encoded text representing a single JSON value into a Aspose.Medical.Dicom.DicomFile.

public static ValueTask<dicomfile?> DeserializeFileAsync(Stream utf8Json, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

JSON data to parse.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

ValueTask < DicomFile ?&gt;

The Aspose.Medical.Dicom.DicomFile or null.

DeserializeList(ReadOnlySpan<char>, DicomJsonSerializerOptions?, bool)

Parses the text representing a single JSON value into a collection of the Aspose.Medical.Dicom.Dataset.

public static Dataset[]? DeserializeList(ReadOnlySpan<char> json, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

json ReadOnlySpan < char &gt;

The JSON text to parse.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

Dataset []?

The Aspose.Medical.Dicom.Dataset or null.

DeserializeList(Stream, DicomJsonSerializerOptions?, bool)

Reads the UTF-8 encoded text representing a JSON value into a collection of the Aspose.Medical.Dicom.Dataset.

public static Dataset[]? DeserializeList(Stream utf8Json, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

JSON data to parse.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

Dataset []?

The Aspose.Medical.Dicom.Dataset or null.

DeserializeListAsync(Stream, DicomJsonSerializerOptions?, bool)

Asynchronously reads the UTF-8 encoded text representing a JSON value into a collection of the Aspose.Medical.Dicom.Dataset.

public static ValueTask<dataset[]?> DeserializeListAsync(Stream utf8Json, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

JSON data to parse.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

ValueTask < Dataset []?&gt;

The Aspose.Medical.Dicom.Dataset or null.

Serialize(Dataset, DicomJsonSerializerOptions?, bool)

Converts a Aspose.Medical.Dicom.Dataset to JSON.

public static string Serialize(Dataset dataset, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

dataset Dataset

DICOM Dataset to be serialized.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

string

Serialize(DicomFile, DicomJsonSerializerOptions?, bool)

Converts a Aspose.Medical.Dicom.DicomFile to JSON.

public static string Serialize(DicomFile dicomFile, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

dicomFile DicomFile

DICOM File to be serialized.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

string

Serialize(Dataset[], DicomJsonSerializerOptions?, bool)

Converts a collection of the Aspose.Medical.Dicom.Dataset to JSON.

public static string Serialize(Dataset[] datasets, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

datasets Dataset []

A list of DICOM Datasets to be serialized.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

string

Serialize(Stream, Dataset, DicomJsonSerializerOptions?, bool)

Converts a Aspose.Medical.Dicom.Dataset to JSON.

public static void Serialize(Stream utf8Json, Dataset dataset, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

The UTF-8 System.IO.Stream to write to.

dataset Dataset

DICOM Dataset to be serialized.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Serialize(Stream, DicomFile, DicomJsonSerializerOptions?, bool)

Converts a Aspose.Medical.Dicom.DicomFile to JSON.

public static void Serialize(Stream utf8Json, DicomFile dataset, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

The UTF-8 System.IO.Stream to write to.

dataset DicomFile

DICOM File to be serialized.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Serialize(Stream, Dataset[], DicomJsonSerializerOptions?, bool)

Converts a collection of the Aspose.Medical.Dicom.Dataset to UTF-8 JSON.

public static void Serialize(Stream utf8Json, Dataset[] datasets, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

The UTF-8 System.IO.Stream to write to.

datasets Dataset []

A list of DICOM Datasets to be serialized.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

SerializeAsync(Stream, Dataset, DicomJsonSerializerOptions?, bool)

Asynchronously converts a Aspose.Medical.Dicom.Dataset to JSON.

public static Task SerializeAsync(Stream utf8Json, Dataset dataset, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

The UTF-8 System.IO.Stream to write to.

dataset Dataset

DICOM Dataset to be serialized.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

Task

SerializeAsync(Stream, DicomFile, DicomJsonSerializerOptions?, bool)

Asynchronously converts a Aspose.Medical.Dicom.DicomFile to JSON.

public static Task SerializeAsync(Stream utf8Json, DicomFile dataset, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

The UTF-8 System.IO.Stream to write to.

dataset DicomFile

DICOM File to be serialized.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

Task

SerializeAsync(Stream, Dataset[], DicomJsonSerializerOptions?, bool)

Asynchronously converts a collection of the Aspose.Medical.Dicom.Dataset to UTF-8 JSON.

public static Task SerializeAsync(Stream utf8Json, Dataset[] datasets, DicomJsonSerializerOptions? dicomJsonOptions = null, bool writeIndented = false)

Parameters

utf8Json Stream

The UTF-8 System.IO.Stream to write to.

datasets Dataset []

A list of DICOM Datasets to be serialized.

dicomJsonOptions DicomJsonSerializerOptions ?

Options that controls serialization/deserialization process of DICOM objects.

writeIndented bool

Specifies whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.

Returns

Task </dataset[]?></char></dicomfile?></char></dataset?></char>