LOADIMAGES Procedure

Example 10.5 Loading DICOM Attributes Along with DICOM Images

(View the complete code for this example.)

This example shows how to use the LOADIMAGES procedure to load DICOM attributes along with their associated DICOM images.

The following statements load certain DICOM attributes along with the DICOM image and other metadata from a directory tree whose root is MyDICOMDirectory and is relative to the path that is associated with the caslib:

proc loadimages libref=mylib path='myDICOMDirectory/000000.dcm';
   output out=mylib.medical_images
      addVars=(WIDTH HEIGHT DEPTH)
      addTags=('0008,0060' '0010,0010')
      addKeywords=('Manufacturer' 'PatientSex');
run;

The following PROC PRINT statement displays the contents of the mylib.medical_images data table that PROC LOADIMAGES generates:

proc print data=mylib.medical_images;
run;

Output 10.5.1 shows the output, which contains the image and metadata columns and the DICOM attributes.

Output 10.5.1: The mylib.medical_images Data Table

Obs_width__height__depth__0008_0060__0010_0010__Manufacturer__PatientSex__image__size__path__type__id_
15125121CTCT_Training-AB123PhilipsF...527465/path/to/images/myDICOMDirectory/000000.dcmdcm1


Last updated: March 26, 2026