⛔️ This repository has been archived, it's code is unmantained.
This was a collaboration with Taylor Burke (MGH) and Tomas Serre, involving the developement of redcap module for image annotation. You can learn more in the scope document
A REDCap external module (EM) that modifies the Image Viewer EM to annotate uploaded images (using markerjs2) in notes box field types.
NOTE: This EM does not include the Image Viewer EM's action tags.
- Enable the Image Annotator EM through REDCap's control center
- Create a new project and enable surveys in your project
- Create a new instrument in the project designer with the following:
- Add a field with using the File Upload field type, your variable name (e.g.,
img_upload), and@IMAGE-ANNOTATE-UPLOADaction tag - Add another field with the Notes Box field type, your variable name (e.g.,
img_annotate), and@IMAGE-ANNOTATEaction tag assigned to your image upload variable name (e.g.,@IMAGE-ANNOTATE="img_upload")
- Add a field with using the File Upload field type, your variable name (e.g.,
- JPEG (.jpeg, .jpg, .jpe)
- PNG (.png)
- TIF (.tiff)
- GIF (.gif)
This module saves the annotation data within the note box field that will be available when exporting records as a CSV file. To export records:
- Navigate to Data Exports, Reports, and Stats
- Click Export Data, select CSV/Microsoft Excel (raw data) format, click Export Data, and then click on the EXCEL CSV icon to choose a destination to save the data
Each row will be a record and each column will be a data point collected, with the column name being the variable name for a field in the survey. The import columns to take note in the exported CSV are columns with the annotation data. On the backend, when a user creates and accepts an annotation, the annotation data is represented as a JSON object encoded as a string to be inserted into the Notes Box field type within REDCap. This allows the annotation data to be exported within the CSV file. More explicitly, the annotation data from markerjs2 is strictly a FreehandMarker object which will have certain properties depending on the annotation created.
To export the images uploaded:
- Navigate to Data Exports, Reports, and Stats
- Click the Other Export Options tab and click the ZIP icon for ZIP file of uploaded files (all records) to choose a destination to save the data
- When unzipped, it will contain the uploaded images with file naming scheme of
{record_ID}_{field_variable_name}.jpegwhererecord_idis the ID assigned to the record and thefield_variable_nameis the variable name for field it was uploaded to. For example, below is the export of a single image with the variable nameimg_upload:
Data for this demo can be located at demo_data.








