Anatomical fiducials (AFIDs) is an open framework for evaluating correspondence in brain images and teaching neuroanatomy using anatomical fiducial placement. The AFIDs Validator project aims to build a web application that allows the user to upload an FCSV file generated using the AFIDs protocol, and validate that it conforms to the protocol.
poetry
is used to manage dependencies. To install, run the following command:
curl -sSL https://install.python-poetry.org | python3 -
For detailed setup instructions, see the documentation here.
Once installed, you can set up your development environment by:
- Git clone the afids-validator repository
git clone https://github.com/afids/afids-validator.git
- Set up python environment via
poetry shell
- Install the required libraries via
poetry install --with dev
- Install the pre-commit action via
poetry run poe setup
. This will automatically perform quality tasks for each new commit. - Update configuration in
.env.template
and rename to.env
file
This will allow you to make changes and perform the necessary formatting and linting tasks. To test changes, the easiest way is via docker compose
. To use this, you will need to install Docker.
Once installed, you can run docker compose up --build
in the terminal.
If there are no errors, you can test it out locally at http://localhost:5001
After you are done testing, you can hit CTRL/CMD+C
on the terminal to exit out of the instance and run docker compose down
to remove unused containers.
If docker compose
successfully starts the required services, you will first want to enter the afids-validator container interactively to migrate the database, enabling testing of database uploads.
# Enter the container interactively
docker exec -it afids-validator-afidsvalidator-1 bash
# Migrate the database
flask db upgrade -d /usr/local/lib/python3.9/dist-packages/migrations/
Note: You may need to change the container name (i.e. afids-validator-afidsvalidator-1
) accordingly.
To test the login with ORCID iD:
- Create an account (with a mailinator.com email address) on sandbox.orcid.org
- Follow these instructions to get a client ID and client secret. Set the
Redirect URIs
to your local testing address (eg.127.0.0.1:5001
,localhost:5001
) - Update your local
.env
file with your new credentials. - Locally change the URLs in
afidsvalidator/orcid.py
to start with api.sandbox.orcid.org - Run the application and test your login.