#!/bin/bash

for scan_id in $(ls data/scans); do
    echo $scan_id
    outd=data/samples/scan-${scan_id}
    mkdir -p data/samples/scan-${scan_id}
# data/scans/80423/80423.txt
# data/scans/80423/80423-std.jpg
# data/scans/80423/80423-qr-side-by-side.jpg
# data/scans/80423/80423-frame.jpg
# data/scans/80423/80423.json
# data/scans/80423/80423-roi.jpg
# data/scans/80423/80423-std-qr.jpg
# data/scans/80423/80423-qr.jpg
    mv data/scans/${scan_id}/${scan_id}.json $outd/metadata.json
    mv data/scans/${scan_id}/${scan_id}-frame.jpg $outd/frame.jpg
    mv data/scans/${scan_id}/${scan_id}-qr.jpg $outd/frame-qr.jpg
    mv data/scans/${scan_id}/${scan_id}-std.jpg $outd/std.jpg
    mv data/scans/${scan_id}/${scan_id}-std-qr.jpg $outd/std-qr.jpg
    mv data/scans/${scan_id}/${scan_id}-qr-side-by-side.jpg $outd/side-by-side.jpg
done

