Scénario de test & Cas d'usage
Create a table of MRI scans. Some scans have coordinates for anomalies, while others have a missing value in the points column, simulating scans with no detected issues.
| 1 | DATA casuser.mri_scans; |
| 2 | LENGTH patient_id $15 _points_ $100 scan_date $10; |
| 3 | patient_id = 'P001'; scan_date = '2023-10-25'; _points_='x:256,y:250'; OUTPUT; |
| 4 | patient_id = 'P002'; scan_date = '2023-10-26'; _points_=''; OUTPUT; /* Missing annotation */ |
| 5 | patient_id = 'P003'; scan_date = '2023-10-27'; _points_='x:128,y:300;x:400,y:150'; OUTPUT; |
| 6 | patient_id = 'P004'; scan_date = '2023-10-28'; _points_='.'; OUTPUT; /* Missing annotation */ |
| 7 | RUN; |
| 1 | PROC CAS; |
| 2 | TABLE.loadTable / |
| 3 | caslib='casuser' path='mri_scans.sashdat' |
| 4 | casOut={name='mri_scans_input', caslib='casuser', replace=true}; |
| 5 | QUIT; |
| 1 | PROC CAS; |
| 2 | image.annotateImages / |
| 3 | TABLE={name='mri_scans_input', caslib='casuser'} |
| 4 | casOut={name='mri_scans_annotated', caslib='casuser', replace=true} |
| 5 | copyVars={'patient_id'} |
| 6 | annotations=[ |
| 7 | {annotation={annotationType='POINTS', r=255, g=255, b=0, thickness=5, representation={representationType='SINGLE_COLUMN', columnName='_points_'}}} |
| 8 | ]; |
| 9 | QUIT; |
The action should execute without errors. The output table `mri_scans_annotated` will contain all four images. The images for patients P001 and P003 will have bright yellow points marking the anomalies. The images for patients P002 and P004, which had missing annotation data, will be present but unaltered. This confirms the action's stability with incomplete annotation data.