Package: garjus
garjusGarjus processes imaging data stored in REDCap and XNAT. All related settings are stored in REDCap. Each automation that runs is logged in REDCap. Any issues encountered are recorded in REDCap. Progress snapshots are stored in REDCap. Current views are in the dashboard.Garjus is the interface to everything that's stored in XNAT/REDCap. It uses
REDCap to store it's own settings and tracking data. Anytime we want to
access these data in REDCap or XNAT in python or CLI, we use Garjus in between.
Creating a Garjus instance means setting up the interfaces with XNAT/REDCap.The main Garjus class provides these data access methods that
all return a Pandas DataFrame:activity()
analyses()
assessors()
automations()
issues()
phantoms()
processing_protocols()
progress()
scans()
subjects()
subject_assessors()
stats(project)
tasks()To get the columns in each dataframe:column_names(type)
e.g. 
column_names('issues')
or
column_names('scans')These Garjus methods returns names in a list:stattypes(project)
scantypes(project)
proctypes(project)
stats_assessors(project)
stats_projects()Command-line interface subcommands:activity - display activity
analyses - display analyses
compare - run data entry comparison
copysess - copy an imaging session from one project to another
d2q - apply updates from dax queue on local disk to garjus task queue in REDCap
dashboard - start a dashboard server and browse to it in a new local web browser tab
delete - delete a proctype from a project
getinputs - download inputs for an analysis
image03csv - create an NDA image03 formatted csv file for a project and date range
image03download - download all images for an NDA image03 csv file
importdicom - import DICOM into XNAT from local file or remote URL
issues - display issues
pdf
processing
progress
q2d - apply updates from garjus REDCap queue to dax local disk queue by writing new batch scripts
quicktest - test connections
report - creates a summary PDF
retry - find jobs that have run once an run them again
run
setsesstype
setsite
stats
subjects
tasks
updateScanning Automations:xnat_auto_archive - archives scans in XNATxnat_session_relabel - modifies labels in XNAT based on a set of rules to set the site and session typexnat_scan_relabel - relabels scan type in XNAT using a simple map of input to output labelsEDAT Automations:edat_convert - convert files, input is from redcap file field, outputs to redcap file fieldedat_limbo2redcap - load files from a local folderedat_redcap2xnat - copy edat files from REDCap to XNATedat_etl - extract data from files uploaded to redcap, transform (calculate accuracy, times), load to redcapnihtoolbox_etl - extract and load NIH toolbox outputsexaminer_etl - extract and load NIH Examiner outputsIssuesAny issues or errors encountered by garjus are recorded in REDCap.
Issues are automatically resolved when the error or issues is no longer found.
Resolved issues are deleted one week after resolution.ActivityEach complete automation is recorded in activity.Set upCreate a new Garjus main REDCap project:upload from zip (see misc folder)click user rights, enable API export/import, save changesrefresh, click API, click Generate API Token, click Copygo to ~/.redcap.txtpaste key, copy & paste PID from gui, name it "main"Create first stats REDCap project:upload from zip (see misc folder)click user rights, check enable API export/import, click save changesRefresh page, click API, click Generate API Token, click CopyGo to ~/.redcap.txtPaste key, copy & paste ID, namePaste ID into ccmutils under Main > Project StatsCreate additional stats REDCap projects:Copy an existing project in gui under Other Functionality, click Copy ProjectChange the project nameConfirm checkboxes for Users, FolderClick Copy Project (should take you to new project)In the new project, click user rights, check enable API export/import, click save changesRefresh page, click API, click Generate API Token, click CopyGo to ~/.redcap.txtPaste key, copy & paste ID, name mainPaste ID into ccmutils under Main > Project StatsAdd a new primary REDCap project to link individual study to garjus:Copy PID, key to ~/.redcap.txt, name PROJECT primarypaste ID into ccmutils under Main > Project PrimaryAdd a new secondary REDCap project for double entry comparison:Copy PID, key to ~/.redcap.txt, name PROJECT secondarypaste ID into ccmutils under Main > Project SecondaryQuickstartpip install garjusorpip install git+https://github.com/bud42/garjus.gitorpip install git+https://github.com/bud42/garjus.git@v1.0.0QA Dashboard without REDCap, only XNATThe garjus QA dashboard can be used with only XNAT access. First, you'll need credentials in
your home directory. The same as dax, you need a .netrc file in your home directory with machine, login, and password in plain text. This file should only be readable by the owner.machine xnat.vanderbilt.edu
login XNAT_USERNAME
password XNAT_PASSWORDThen install garjus and launch the dashboard. To install in a new python 3 environment:python -m venv venv-garjusThen load the new virtual environment with:source venv-garjus/bin/activateAnd then install garjus in the venv with:pip install garjusIf you encounter an error with scikit learn, you can bypass it with:export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True && pip install garjusAfter garjus is successfully installed, you can launch a dashboard with:garjus dashboardThis should open a new tab in your web browser at the dashboard main pagehttp://localhost:8050.
Choose one or more projects from the drop down. The options should include all projects that are accessible to your XNAT account using the credentials in your .netrc file.
Find a problem? Please report an issue. Got an idea? Open a Discussion. Thanks!