DicomDataSetSaveXmlFlags Enumeration

Summary
Specifies flags to be used with the SaveXml methods.
Syntax
C#
C++/CLI
[FlagsAttribute()] 
public enum DicomDataSetSaveXmlFlags   
[FlagsAttribute()] 
public enum class DicomDataSetSaveXmlFlags   
Members
Value Member Description
0x00000000 None Pass this value if you do not want to use any other flags. The default values will be used.
0x00000001 IgnoreBinaryData If a DICOM element contains binary data, do not write the binary data to the output XML 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 XML file. All elements are still exported, but have no data.
0x00000004 EncodeBinaryBase64 Encode all binary data as Base64. This is the default behavior.
0x00000008 EncodeBinaryBinHex Encode all binary data as BinHex. This overrides the default behavior of encoding binary data as Base64.
0x00000010 TagWithCommas When writing DICOM tags to the output XML file, use commas. For example, write the tag for SOPClassUID as '0008,0016' instead of '00080016'
0x00000020 TrimWhiteSpace When writing data to the output XML file, trim leading and trailing white spaces.
0x00000040 NativeDicomModel Use as the XML output format the Native DICOM model described in PS3.19 of the DICOM Specification. For an example, refer to SaveXmlData.BinaryType.
0x00000080 WriteFullEndElement Write the full XML end element, instead of a single element (i.e. instead of ).
0x00000100 IgnorePixelData Do not include the pixel data element in the resulting XML.
0x00000200 InlineBinary Encode all binary data as InlineBinary, which is coded as Base64 with a line break after every 76 characters. The following flags are only used with the Native DICOM Model, and affect how binary data is written. Unless the NativeDicomModel is also included, all of the following flags are ignored. Callers can pass one or more of the three flags. If more than one of the flags is passed, precedence is given in the order that they appear below.
InlineBinary
BulkDataUri
BulkDataUuid
Passing more than one flag will cause the SaveXmlCallback to behave differently. For example, passing BulkDataUri and BulkDataUuid will cause the SaveXmlCallback to generate values for BulkDataUri and BulkDataUuid. If none of these three flags is passed, the default behavior is BulkDataUuid.
0x00000400 BulkDataUri Write all binary data as BulkDataUri, with a dummy Uri. The following flags are only used with the Native DICOM Model, and affect how binary data is written. Unless the NativeDicomModel flag is also included, all of the following flags are ignored. Callers can pass one or more of the following three flags. If more than one of the flags is passed, precedence is given in the order that they appear below.
InlineBinary
BulkDataUri
BulkDataUuid
Passing more than one flag will cause the SaveXmlCallback to behave differently. For example, passing BulkDataUri and BulkDataUuid will cause the SaveXmlCallback to generate value BulkDataUri and BulkDataUuid. If none of these three flags is passed, the default behavior is BulkDataUuid. For an example, refer to BulkDataUri.
0x00000800 BulkDataUuid Write all binary data as BulkData, with a dummy uuid attribute. This is the default behavior. The following flags are only used with the Native DICOM Model, and affect how binary data is written. Unless the NativeDicomModel is also included, all of the following flags are ignored. Callers can pass one or more of the three flags. If more than one of the flags is passed, precedence is given in the order that they appear below.
InlineBinary
BulkDataUri
BulkDataUuid
Passing more than one flag will cause the SaveXmlCallback to behave differently. For example, passing BulkDataUri and BulkDataUuid will cause the SaveXmlCallback to generate values for both BulkDataUri and BulkDataUuid. If none of these three flags is passed, the default behavior is BulkDataUuid. For an example, refer to InlineBinary.
0x00001000 NativeNoModifyPrivateElements PS3.19 of the DICOM Specification states that a Private Data Element has the form gggg00ee, where the two most significant hexadecimal values of the element number are set to 00. Pass the 'NativeNoModifyPrivateElements' flag to preserve the upper two most significant hexadecimal values of the element.
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 void LoadXmlExample() 
{ 
   string dicomFileNameIn = Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "image3.dcm"); 
   string xmlFileNameOut = Path.Combine(LEAD_VARS.ImagesDir, "test.xml"); 
 
   // Initialize DICOM engine 
   DicomEngine.Startup(); 
 
   DicomDataSet ds = new DicomDataSet(); 
 
   // Load an existing DICOM file 
   ds.Load(dicomFileNameIn, DicomDataSetLoadFlags.None); 
 
   // Save as XML with no binary data 
   // For the demo, keep the XML output file size small by skipping the pixel data 
   DicomDataSetSaveXmlFlags xmlFlags = 
      DicomDataSetSaveXmlFlags.IgnoreBinaryData | 
      DicomDataSetSaveXmlFlags.TrimWhiteSpace | 
      DicomDataSetSaveXmlFlags.TagWithCommas; 
   ds.SaveXml(xmlFileNameOut, xmlFlags); 
 
   // Now reload the XML file.   
   // Note that there will not be an image because we skipped the pixel data in the save 
   ds.LoadXml(xmlFileNameOut, DicomDataSetLoadXmlFlags.None); 
 
   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.