Defining custom scan quality labels

Each scan data type (MR scan, CT scan, etc.) includes a quality label. By default, the scan quality can be set to usable, questionable, or unusable, but the set of scan quality labels can be customized.

To define custom scan quality labels:

  1. Create a plain text file (let's call it scan-quality-labels.txt) containing the custom scan quality labels, separated by commas. For example:

    dunno,great,fine,meh,ugh

    The first label is the default value, so if your custom labels include "undefined" or an equivalent, that should probably come first.

  2. Upload the quality labels file to the scan-quality XNAT configuration service:

    curl -X PUT -u admin https://my.xnat.org/REST/config/scan-quality/labels?inbody=true --data-binary @scan-quality-labels.txt

    Custom scan quality labels can also be defined for an individual project:

    curl -X PUT -u admin https://my.xnat.org/REST/projects/MyProject/config/scan-quality/labels?inbody=true --data-binary @scan-quality-labels.txt
  3. If you want the custom scan quality labels to appear in colors (as the default usable, questionable, and unusable appear in green, orange, and red), modify projects/xnat/src/style/scans.css: Note that the scan quality will appear in color only if the label is a valid CSS identifier – i.e., made up of only 0-9a-fA-F_-

    /* XNAT defaults */
    td.quality-usable {
      color:green;font-weight:700
    }
    td.quality-questionable {
      color:orange;font-weight:700
    }
    td.quality-unusable {
      color:red;font-weight:700
    }
     
    /* My custom labels */
    td.quality-great {
      color:green; font-weight: 700
    }
    td.quality-fine {
    ...


$label.name