Administration

This portion of the guide will show you how to use the Admin module to set up projects, users, and manage other settings for BrICS.

Accessing the Admin Module

In order to access the Admin Module, your account must be an administrator within BrICS. If you are not an administrator, you will need to ask one of the administrators to add you.

Note: if you're running a local version of BrICS, e.g. within a Docker container, by default no authentication is setup, and you are automatically logged in as an administrator.

Once you've logged in to BrICS, open up the left side bar by clicking the menu icon on the top right of the screen. If you're logged in as an administrator, a button labeled Admin will be available.

enter image description here

You will then be taken to the Admin Module.

enter image description here

Admin Module Components

The Admin module has four basic views, which can be accessed from the top menu bar. We will go through each of these on its own page.

Project Management

The Projects tab allows the creation of new BrICS projects and editing of existing ones. Let's start by creating a new project, and then walking through how to set it up.

Create a New Project

Make sure you are on the Projects tab. Then, click Create New. A template for a new project will then load. enter image description here

All fields with an asterisk need to be filled out, though in general it is good to fill out all fields as needed. We will go through each of them one by one below.

proj_id

The proj_id represents the ID for this project. It is an alphanumeric string (no spaces or special characters) that will be used internally to manage all data for this project. You can set it to something memorable (e.g. test_project_jan2019) or something random. Once set, it cannot be changed.

name

The name for the project. This can be any string, and it is useful to make this a quick descriptor of the project. For example, if I were making a project consisting of sMRI scans for grade II glioma biopsies, I might name it "Grade II Biosies"

metabolites

This field consists of a list of metabolites we want to use in this project. It can be edited later, but it's good to set up a few for the time being. Start by click Add Item to enter your first metabolite, and repeat for all additional ones you want. Each metabolite has three fields:

location

Don't set this field manually. It will be automatically determined once you save the project.

midas_autoscan

If you want this BrICS project to be tied to a MIDAS project (which, in most cases, you do), then specify the location of the project here. Remember, the location of the project must be from the context of the BrICS server; BrICS does not have access to your local hardrive. A good way to have a project that can be both edited using MIDAS on your local computer and visible to BrICS is to put it on a shared drive accessible by both machines.

Double-lick on the field to open up a server-side file browser. Our laboratory's shared drive (the so-called ShimLab Array or Synology Array) is already mounted on BrICS server under /array, so you can access projects from within there.

enter image description here

Find the folder for the MIDAS project. This must be the folder where the project.xml file is located. Then click Open.

invert_spectrum

This field indicates whether all the spectra in this project are inverted (i.e. upside-down). This occurs on some scanners / sequences when there is a 180 degree phase shift. MIDAS will usually fix this during its phase-correction, and so for most projects, select False for this field. However, for projects where the spectra do appear upside-down, select True.

autonorm

This field indicates whether or not to normalize all metabolite series by contralateral normal appearing white matter (NAWM). See below for which options are available for normalization. In most cases, you want this to be set to True.

autonorm_algorithm

There are currently two NAWM algorithms available in BrICS. The first is the Cho/NAA Gaussian Mixture Model (Cho/NAA GMM), which uses the Cho/NAA map to find the distribution between normal and pathologic tissue. (see Gurbani et. al., Tomography 2019). The second is to use a T1-based segmentation built into MIDAS; this second option requires the nawm utility in MIDAS to be run as part of batch processing. By default, we recommend using the MIDAS NAWM algorithm.

redcap

This set of fields allows this BrICS project to be connected to a REDCap database for pulling in subject metadata.

Once all these fields have been set, click the green Add button to add this project to BrICS. If there are any errors, you will be alerted.

Editing an Existing Project

You can edit an existing project by selecting it from the drop-down menu in the Project Management view. Some fields, such as proj_id, cannot be edited after initial creation; however, most fields can, and the changes you make will immediately be available in BrICS.

Next Steps

Once a project has been created (or edited), you will want to assign which Users should have access to it. Go to User Management.

User Management

The User tab allows the creation, editing, and management of Users.

Authentication

BrICS can currently use two types of authentication - Shibboleth or the Auth0 service. Shibboleth allows one to login via single-sign on (SSO) using their institutional (e.g. Emory NetID) credentials. Auth0 is a third party service that also allows SSO using a variety of providers, such as Google, GitHub, Microsoft, etc. There is a slight difference in how users are setup from each, so we'll include info on both below.

Currently, the main BrICS installation at https://brics.me utilizes Auth0 with sign-in through Google; if a different provider is selected, the instructions below may need to be adjusted.

Creating a New User

From the User Management view, click Create New. A template will load. All fields with asterisks are required to be filled out.

enter image description here

username

The username for this user. When using Shibboleth at Emory, this will be user's NetID. When using Auth0 (default), this will be the local-part of the user's email address. For example, if I login with coolbricsuser101@gmail.com, my username would be coolbricsuser101.

email

The user's email address.

display_name

What the user will be displayed as in BrICS. Often, we'll use a full name with credentials (e.g. Hyunsuk Shim, PhD) for our clinical studies.

administrator

A field that specifies whether the user should be a BrICS administrator. By default, this should be set to False; for developers and project leads, this should be set to True.

project_list

This field is a list of projects the user should have access to. Select Add Item for each project the user should have access to. For each project, you will need to type in the project_id (see Project Management for more info on this field). If you start typing in a project_id, an autocomplete field will popup.

enter image description here

Editing Users

You can edit an existing user by selecting it from the drop-down menu in the User Management view.

Environmental Variables

BrICS consists of many different components. One of the core components is a C++ extension to PHP, named libbrics, that enables much of the image processing and spectral processing functions used by the app. Since libbrics needs to be compiled to binary code whenever changes are made to the C++ source files, we need a way to pass certain variables dynamically to it. For this, we use a special collection within our MongoDB database that libbrics can access. This collection can be modified in real-time using the Environmental Variables view in BrICS Admin.

enter image description here

Each variable has two fields:

Unit Testing

The Unit Testing view enables quick testing of many of the components of BrICS. It is composed of unit tests - individual scripts that assess whether a specific function of BrICS is working. These can be developed for things like connectivity checks, algorithms, and connections between modules.

Unit tests are stored in the main BrICS repository under html/admin/tests.

This view allows you to quickly run either specific tests, a specific category of tests, or all tests.

enter image description here

Running a Test

To run a single test, click the Run button next to a test. The server will kick off the test and update when the test completes or errors out.

To run all tests within a category, click the Run All button for that category.

Note: The first time a test is run, it will be in the "Uncategorized" category. Once it successfully completes, it will go into it's specified category.

To run all tests, scroll to the bottom of the page and click the blue button labeled RUN ALL TESTS.

Note: Running all tests can take a long time, and will lock up the BrICS server while these are running. This is important to run if there have been major changes made to the code base, and should be run when others are not expecting to use the app.

Assessing Test Results

Once a test is run, it will return one of three possible outcomes.

Passed

The test completed and returned a successful outcome. If there are any success messages from the test, they will be displayed (i.e. "the test received the expected outcome of xxxx").

enter image description here

Error

The test completed, but the outcome was not as expected. The response message will give insight as to what the issue is. For example, in the image below, the test which tries to connect to Emory's REDCap database failed because the API credentials in the test script were incorrect.

enter image description here

Script Error

There was an error in the test script itself, and so the test could not be completed. This requires debugging of the test script and to remove any elements that could be causing a fatal error that prevents the script crom completing.

enter image description here