You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are right, that one overload is missing. It will be included in next release. If you cannot wait so long, you can do meanwhile the following:
The code of ConvertDicomToJson is:
public static string ConvertDicomToJson(DicomDataset dataset, bool writeTagsAsKeywords = false, bool formatIndented = false)
{
var options = new JsonSerializerOptions();
options.Converters.Add(new DicomJsonConverter(writeTagsAsKeywords: writeTagsAsKeywords));
options.WriteIndented = formatIndented;
var conv = JsonSerializer.Serialize(dataset, options);
return conv;
}
Those are all public classes, no private or internal code, so you can copy this method into your project and replace the DicomDataset parameter to a DicomDataset[] array parameter, or a IEnumerable<DicomDataset>. The rest still works the same.
I'm trying to convert a List of DicomDataset to a json string, but I can't find the right method to do so in fo-dicom 5.0
When I was using fo-dicom 4.7, i was using the following :
JsonConvert.SerializeObject(studiesListDataSet, new Dicom.Serialization.JsonDicomConverter());
Expected behavior
To have a method in FellowOakDicom.Serialization.DicomJson to convert a List of DicomDataset to a string json.
Method that should exist : ConvertDicomArrayToJson
Does it already exist and I haven't installed the correct package ?
Actual behavior
Actual methods are : ConvertDicomToJson, ConvertJsonToDicom and ConvertJsonToDicomArray
fo-dicom version and OS/platform
fo-dicom 5.0
The text was updated successfully, but these errors were encountered: