DicomDataSetSaveJsonFlags Enumeration

Summary
Specifies flags to be used with the SaveJson methods.
Syntax
C#
C++/CLI
[FlagsAttribute()] 
public enum DicomDataSetSaveJsonFlags   
[FlagsAttribute()] 
public enum class DicomDataSetSaveJsonFlags   
Members
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
Example
C#
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:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.1.30
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom.Common Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.