Scénario de test & Cas d'usage
Create a dataset with mixed-quality data: one valid image, one image that is smaller than the intended crop size, one record with a null image, and one with invalid (text) data in the image column.
| 1 | DATA casuser.medical_scans; |
| 2 | LENGTH patient_id $15. _image_ $200.; |
| 3 | INFILE DATALINES dsd dlm='|'; |
| 4 | INPUT patient_id $ _dimension_ _resolution_ _image_ $; |
| 5 | DATALINES; |
| 6 | PID-VALID-01|1024|1024|...valid_binary_xray_data... |
| 7 | PID-TOO-SMALL-02|100|100|...small_binary_xray_data... |
| 8 | PID-NULL-IMG-03|1024|1024|. |
| 9 | PID-BAD-DATA-04|1024|1024|this_is_not_image_data |
| 10 | ; |
| 11 | RUN; |
| 12 | |
| 13 | PROC CASUTIL; |
| 14 | load DATA=casuser.medical_scans casout='medical_scans' replace; |
| 15 | QUIT; |
| 1 | PROC CAS; |
| 2 | image.augmentImages / |
| 3 | TABLE='medical_scans', |
| 4 | decode=TRUE, |
| 5 | copyVars={'patient_id'}, |
| 6 | augmentations={{ |
| 7 | x=0, y=0, width=256, height=256 |
| 8 | }}, |
| 9 | casOut={name='scans_robustness_test', caslib='casuser', replace=TRUE}; |
| 10 | QUIT; |
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.fetch / TABLE='scans_robustness_test'; |
| 4 | QUIT; |
| 5 |
The `image.augmentImages` action in step 1 should execute without crashing. The CAS log may contain warnings or errors for the problematic records. The output table 'scans_robustness_test', when fetched in step 2, must contain exactly one row corresponding to 'PID-VALID-01'. The records for the image that was too small, had null data, or had invalid data should be gracefully ignored and not result in any output rows. This demonstrates the action's resilience in a real-world, imperfect data environment.