Visual Basic |
---|
Public Sub Add( _ ByVal dataset As Object _ ) |
The new member is added at the end of the collection (it may subsequently be moved using Move if necessary). If the DicomImages collection to which an image is added belongs to a DicomViewer control, the control’s CurrentIndex property may be adjusted if AutoDisplay is True.
When added to a DicomDataSets collection, a reference to the existing object is added to the collection, as this is then often used for creating dicomdir tree structures etc. However, it is often useful to create multiple displayed versions of a single image, so when used with a DicomImages collection, the display parameters are created as a new object, but still referencing the same underlying DICOM dataset, thereby conserving memory. Using this feature it is possible to show two versions of an image, showing different frames or with different magnification or windowing, without doubling the memory requirements.
The parameter to this method is actually declared as a generic IDispatch object, allowing both DicomImage and DicomDataSet objects to be added to either type of collection. This is particularly useful when manipulating images embedded within sequences such as thumbnails within a DICOMDIR, as the object added acquires the type of the collection to which it is added, whilst retaining the same underlying DICOM dataset.