/afids-validator

Validator for the anatomical fiducial placement protocol

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

AFIDs

AFIDs Validator CI AFIDs Validator Release GitHub release (latest SemVer) License: GPL v3 Code style: black

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.

Development

poetry (v1.2.0) is used to manage dependencies. To install, run the following command:

curl -sSL https://install.python-poetry.org | python3 - --version 1.2.0

For detailed setup instructions, see the documentation here.

Required Packages

Install via apt-get or snap

  • postgresql

Setup for local testing

  1. Git clone the afids-validator repository git clone https://github.com/afids/afids-validator.git
  2. Set up python environment via poetry shell
  3. Install the required libraries via poetry install --with dev
  4. Install the pre-commit action via poetry run poe setup. This will automatically perform quality tasks for each new commit.
  5. Access the postgres CLI via sudo su - postgres
  6. Create a database via postgres createdb fid_db
  7. Set password for the created database
    psql fid_db
    \password
    
  8. Update configuration in .env.template and rename to .env file
  9. python manage.py db upgrade
  10. python manage.py runserver

If there are no errors, you can test it out locally at http://localhost:5000

Testing login

To test the login with ORCID iD:

  1. Create an account (with a mailinator.com email address) on sandbox.orcid.org
  2. 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:5000, localhost:5000)
  3. Update your local .env file with your new credentials.
  4. Locally change the URLs in afidsvalidator/orcid.py to start with api.sandbox.orcid.org
  5. Run the application and test your login.