[FlagsAttribute()]
public enum DicomDataSetSaveJsonFlags
[FlagsAttribute()]
public enum class DicomDataSetSaveJsonFlags
Value | Member | Description |
---|---|---|
0x00000000 | None | Pass this value if you do not want to use any other flags. Default values will be used. |
0x00000001 | IgnoreBinaryData | If a DICOM element contains binary data, do not write the binary data to the output JSON file. The element itself is still exported, but has no data. |
0x00000002 | IgnoreAllData | Do not write any data (binary, text, etc.) for the DICOM elements to the output JSON file. All elements are still exported, but have no data. |
0x00000020 | TrimWhiteSpace | When writing data to the output XML file, trim leading and trailing white spaces. |
0x00000100 | IgnorePixelData | Do not write the pixel data elements to the output JSON file. |
0x00000200 | InlineBinary | Encode all binary data as InlineBinary, which is coded as Base64 with a line break after every 76 characters. InlineBinary is one of two flags, shown in the following list, that affect how binary data is written. • InlineBinary • BulkDataUri If neither of these two flags are passed, the default behavior is BulkDataUri. If both of these flags are passed, InlineBinary takes precedence, but the BulkDataUri flag will cause the SaveJsonCallback to generate a value for BulkDataUri For an example, refer to SaveJson. |
0x00000400 | BulkDataUri | Write all binary data as BulkDataUri, using a dummy URI. This is the default behavior. BulkDataUri is one of two flags, shown in the following list, that affect how binary data is written. • InlineBinary • BulkDataUri If neither flag is passed, the default behavior is BulkDataUri. If both flags are passed, InlineBinary takes precedence, but the BulkDataUri flag will cause the SaveJsonCallback to generate a value for BulkDataUri. |
0x00002000 | WriteKeyword | Include the 'keyword' member for each JSON object DICOM element. |
0x00004000 | Minify | Minify the JSON by removing comments and whitespace. |
0x00008000 | Base64NoLineBreaks | Used with the InlineBinary enum to encode binary data as Base64 no line breaks. Without this flag, encoded Base64 data has a line break after every 76 characters. |
0x00010000 | IgnoreMetaData | Do not write the DICOM (0002,0001) File Meta Information Version element |
using Leadtools.Dicom;
using Leadtools.Dicom.Common;
using Leadtools.Dicom.Common.Extensions;
using Leadtools;
using Leadtools.Dicom.Common.Linq.BasicDirectory;
using Leadtools.Dicom.Common.DataTypes;
using Leadtools.Codecs;
public static void SaveJsonExample()
{
string dicomFileNameIn = Path.Combine(LEAD_VARS.ImagesDir, "IMAGE3.dcm");
string xmlFileNameOut = Path.Combine(LEAD_VARS.ImagesDir, "test.json");
DicomEngine.Startup();
DicomDataSet ds = new DicomDataSet();
// Load an existing DICOM file
ds.Load(dicomFileNameIn, DicomDataSetLoadFlags.None);
ds.SaveJson(xmlFileNameOut, DicomDataSetSaveJsonFlags.InlineBinary);
DicomEngine.Shutdown();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}
Leadtools.Dicom.Common.Extensions Namespace
SaveJson(DicomDataSet,String,DicomDataSetSaveJsonFlags,SaveJsonCallback) Method
SaveJson(DicomDataSet,Stream,DicomDataSetSaveJsonFlags,SaveJsonCallback) Method
SaveJson(DicomDataSet,String,DicomDataSetSaveJsonFlags) Method
SaveJson(DicomDataSet,Stream,DicomDataSetSaveJsonFlags) Method
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document