LOADDICOMDATA Procedure
Getting Started: LOADDICOMDATA Procedure
(View the complete code for this example.)
This example loads two DICOM keywords that are associated with a DICOM file: Patient’s Age and Patient’s Sex. DICOM keywords are written in plain English, but in code and output underscores are often inserted. This example assumes that the CAS engine libref "mylib" and the caslib that is associated with "mylib" have already been created. For more information, see the section Setting Up Your Environment for Working with Images in Chapter 1, Shared Concepts.
The following statements use PROC LOADDICOMDATA to load a DICOM file from the specified path and generate output in the mylib.dicom_data data table, which is specified in the OUTPUT statement. The specified path must be relative to the caslib that is associated with the "mylib" libref:
proc loaddicomdata libref=mylib path='path/to/dicom/sample.dcm';
output out=mylib.dicom_data addkeywords=('PatientAge' 'PatientSex');
run;
The following PROC PRINT statement displays the contents of the mylib.dicom_data data table that PROC LOADDICOMDATA generates:
proc print data=mylib.dicom_data;
run;
Figure 1 shows the output of PROC PRINT, which contains the two specified DICOM keywords.
Figure 1: The mylib.dicom_data Data Table
| Obs | _id_ | _path_ | _PatientAge_ | _PatientSex_ |
|---|---|---|---|---|
| 1 | 1 | /path/to/dicom/sample.dcm | 073Y | F |