# GDLffDICOM__assoc

The GDLffDICOM__assoc class provides methods to read and update images embedded in a DICOM Part 10 file. The GDLffDICOM__assoc class takes advantage to the IDL assoc f unction to allow for direct access to frame data in the DICOM file. Such direct access means that you cannot make alter the image dimensions.

The GDLffDICOM__assoc class also provides a method for generating a new SOP Instance UID. Generating a new UID is necessary if you intend on altering the DICOM file. If you do not generate a new UID then you may experience data loss:

- A vendor may not import your image because it appears to already exist in their database. (Expected behavior according to the DICOM standard)
- A vendor will overwrite any images in their database which appear to have the same UID.

## Limitations

- Because of the nature of direct access, changes to DICOM files are committed immediately, thus there is no way to rollback in the event of an error.
- The GDLffDICOM__assoc class does not support the manipulation of image dimensions.
- By default, the GDLffDICOM__assoc class does not recognise sequences of tags. Thus, GDLffDICOM__assoc will completely skip over sequences which have their length explicitly set unless you use the /INDEX_SEQUENCES keyword

## Example

; Initialise the DICOM update class

du = obj_new('GDLffDICOM__assoc')

; Open and parse the DICOM file

if (du -> open('image.dcm')) then begin

; Associate the image embedded in the file

images = du -> assoc(COUNT=count)

; Display the slices

for i=0l,count-1l do tvscl, images[i], i

; Close the file

du -> close

endif

; Cleanup

obj_destroy, du