LEADTOOLS Medical (Leadtools.Dicom assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
Initialize(DicomClassType,DicomDataSetInitializeFlags) Method
See Also 
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. Supported in Silverlight, Windows Phone 7.

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.dcm", 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.dcm", DicomDataSetSaveFlags.None);
}
SilverlightCSharpCopy Code
void DicomDataSet_InitializeExample(Stream outputStream)
{
   DicomDataSet ds = new DicomDataSet();
   DicomDataSetInitializeFlags flags =
      DicomDataSetInitializeFlags.ExplicitVR |
      DicomDataSetInitializeFlags.LittleEndian |
      DicomDataSetInitializeFlags.AddMandatoryElementsOnly |
      DicomDataSetInitializeFlags.AddMandatoryModulesOnly
      ;
   ds.Initialize(DicomClassType.CTImageStorage, flags);
   ds.Save(outputStream, DicomDataSetSaveFlags.None);
}
SilverlightVBCopy Code
Private Sub DicomDataSet_InitializeExample(ByVal outputStream As Stream)
   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(outputStream, DicomDataSetSaveFlags.None)
End Sub

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also

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