Python scripts for bulk-managing slides, annotations, and metadata on the Digital Slide Archive (DSA / HistomicsUI) servers:
| Server | API URL |
|---|---|
| Athena (official) | https://athena.rc.ufl.edu/api/v1/ |
| DevAthena (testing) | https://devathena.rc.ufl.edu/api/v1/ |
All scripts talk to the server through the Girder REST API using the girder-client Python package.
| Folder | Script(s) | Purpose |
|---|---|---|
KPMP/annotation_namechange_accesscontrol |
annotation_namechange_accesscontrol.py |
Rename annotation layers and control which layers non-admin users can see (dry run, backups, undo) |
KPMP/annotation_access_control |
annotation_access_control.py |
Remove specific users from annotation access lists, except for kept layers |
KPMP/remove_metadata |
remove_metadata.py |
Delete user metadata from every item in a folder |
KPMP/Metadata |
Metadata.py, Metadata.sh, metadata_csv.py, annotations_user_large_metadata.py, common.py |
Export metadata, annotations, and files from Athena to HiPerGator and combine metadata into a CSV |
Each folder has its own README with full instructions.
Python 3.8 or newer is required. Check with:
python --versionInstall the dependencies:
pip install girder-client pandasOn HiPerGator or a shared system without admin rights, use pip install --user girder-client pandas.
git clone <this-repo-url>
cd DSA-Scripts/KPMP- Log in to the server in your browser (Athena or DevAthena).
- Click your name in the top-right corner, then My account.
- Open the API keys tab and click Create new key.
- Give it a name and choose Allow all actions, then copy the key.
Treat the key like a password. Never paste it into a file you commit to GitHub.
annotation_namechange_accesscontrol.py can also log in with your username and password instead of a key.
Every object on the server has a 24-character ID (e.g. 69e6919a3c7545c729a39e88).
| You need | Where to find it |
|---|---|
| Folder ID | Open the folder in the server's data browser. The ID is the last part of the URL after folder/. You can also click the folder's ⓘ (info) icon. |
| Item (slide) ID | Open the slide in HistomicsUI. The ID is the part of the URL after ?image=. |
| User ID | In the data browser, open Users and click the person. The ID is the part of the URL after user/. |
- Test on DevAthena first, then run on Athena.
- Scripts that change things need the right permissions. Changing access requires admin rights on the annotations (ideally a site admin account). Deleting metadata requires write access to the items.
- All scripts process the given folder and all of its subfolders.
- Keep
runs/andlogs/out of Git (already listed in.gitignore), because they contain user IDs and backups.