Leadtools.Dicom Requires Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Initialize(DicomClassType,DicomDataSetInitializeFlags) Method
See Also  Example
Leadtools.Dicom Namespace > DicomDataSet Class > Initialize Method : Initialize(DicomClassType,DicomDataSetInitializeFlags) Method



classType
The IOD class to which the Data Set should be initialized.
flags
The Value Representation, byte order, and other options used when initializing the Data Set.
classType
The IOD class to which the Data Set should be initialized.
flags
The Value Representation, byte order, and other options used when initializing the Data Set.
Creates the Data Set object, inserting the appropriate elements for the specified class.

Syntax

Visual Basic (Declaration) 
Overloads Public Sub Initialize( _
   ByVal classType As DicomClassType, _
   ByVal flags As DicomDataSetInitializeFlags _
) 
Visual Basic (Usage)Copy Code
Dim instance As DicomDataSet
Dim classType As DicomClassType
Dim flags As DicomDataSetInitializeFlags
 
instance.Initialize(classType, flags)
C# 
public void Initialize( 
   DicomClassType classType,
   DicomDataSetInitializeFlags flags
)
C++/CLI 
public:
void Initialize( 
   DicomClassType classType,
   DicomDataSetInitializeFlags flags
) 

Parameters

classType
The IOD class to which the Data Set should be initialized.
flags
The Value Representation, byte order, and other options used when initializing the Data Set.

Example

This example will initialize a new DICOM data set with only mandatory modules and elements

Visual BasicCopy Code
'''
Private Sub DicomDataSet_InitializeExample()
   Dim ds As DicomDataSet = New DicomDataSet()
   Dim flags As DicomDataSetInitializeFlags = DicomDataSetInitializeFlags.ExplicitVR Or DicomDataSetInitializeFlags.LittleEndian Or DicomDataSetInitializeFlags.AddMandatoryElementsOnly Or DicomDataSetInitializeFlags.AddMandatoryModulesOnly
   ds.Initialize(DicomClassType.CTImageStorage, flags)
   ds.Save(LeadtoolsExamples.Common.ImagesPath.Path + "Test.dic", DicomDataSetSaveFlags.None)
End Sub
C#Copy Code
///  
void DicomDataSet_InitializeExample() 

   DicomDataSet ds = new DicomDataSet(); 
   DicomDataSetInitializeFlags flags = 
      DicomDataSetInitializeFlags.ExplicitVR |  
      DicomDataSetInitializeFlags.LittleEndian |  
      DicomDataSetInitializeFlags.AddMandatoryElementsOnly |  
      DicomDataSetInitializeFlags.AddMandatoryModulesOnly 
      ; 
   ds.Initialize(DicomClassType.CTImageStorage, flags); 
   ds.Save(LeadtoolsExamples.Common.ImagesPath.Path + "Test.dic", DicomDataSetSaveFlags.None); 
}

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

Leadtools.Dicom requires a Medical toolkit server license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features