- I copied the original images in the
images_rawfolder. - I used GIMP to cut each of the images and save to
.pngfiles in theimages_rawfolder. d010_resize_images.pyresizes all cut images and saves them to folderdocs/images- I use
d020_capture_rectangles_for_overlay.pyto capture all the outer rectangular regions with the labels. Saved in theregions/regions.jsonfile. d030_scale_regions_as_rectangles.pygenerates the scaled regions in thedocs/overlays.jsonfile. Here "polygon" is set by default to cover the entire rectangles. This step can be skipped if you rund030_scale_regions_as_rectangles.py.- I use
d040_capture_regions_for_overlay.py d050_scale_regions_as_polygons.pygenerates all the rectangles and internal polygons in thedocs/overlays.jsonfile.
Here's how to use this Google Apps Script with Google Sheets:
1. Set up the Google Sheet:
- Open Google Sheets and create a new spreadsheet
- Create a sheet named
"Responses"(the script looks for this exact name) - Add column headers in the first row:
- Column A: Timestamp
- Column B: Consent
- Column C: Consent Timestamp
- Columns D-R: q01, q02, q03, ... q15
2. Add the script to Google Sheets:
- In your Google Sheet, go to Extensions → Apps Script
- Delete any default code and paste your script
- Save it
3. Deploy as a Web App:
- Click Deploy → New deployment
- Select Type: Web app
- Set Execute as: your Google account
- Set Who has access: Anyone (or "Anyone with the link")
- Click Deploy
HERE GOOGLE ASKS FOR AUTHORIZATION
- Copy the deployment URL (looks like:
https://script.google.com/macros/s/AKfycbw7.../exec)
4. Use the URL in your questionnaire:
- Replace the
SCRIPT_URLin your questionnaire.html with the deployment URL you just copied - When users submit, the POST request sends the JSON data to this URL
- The script automatically parses it and appends a new row to your "Responses" sheet
That's it! Each submission will add a new row with all the response data.