View on GitHub

A scalable, containerized analytic and application framework for creating interactive web applications around long running (batch style) analytics.

Rt 106 Programming Reference

This document accompanies the higher-level descriptions found in the Algorithm SDK and the Application SDK, and provides more detailed programming information.

This document describes the following:

JSON Metadata for Integrating Algorithms

The metadata for an integrated algorithm is documented using a JSON format in rt106SpecificAdaptorDefinisions.json. Several examples are provided in rt106-algorithm-template, simple-region-growing, and wavelet-nuclear-segmentation. Please refer to these as a starting point for your own algorithm’s metadata.

Here is a description of the individual algorithm metadata fields:

Datastore Python data API

These functions are available for the short Python script that you need to write that marshalls data from the Rt 106 datastore to your algorithm and stores generated results back to the datastore.

The Rt 106 data API has been written with an initial focus on medical imaging / radiology data and pathology / microscopy data, but has been designed so that additional data types can be easily added later.

Rt 106 supports a common data API that is independent of storage mechanism. The initial release of Rt 106 includes a “Datastore-Local” implementation which stores data files in a local directory structure. In the future, alternate data storage mechanisms can be built, including direct storage in Amazon S3 or a PACS system.

An important concept for Rt 106 datastores is that a path is a storage location within a datastore, but the format of the path may be specific for the type of datatore. Therefore, code that calls the data API should never presume to know the structure of paths; the path should always be obtained from an API call to the datastore that returns a path.

Medical Imaging / Radiology Data API Calls

Pathology / Microscopy Data API Calls

Data API Calls that Pertain to Any Type of Data

REST API Provided by rt106-server

Efforts have been made to define a stable API even for the initial release of Rt 106. Over time, we expect new API calls to be added, especially to support additional data types. Our goal is minimize changes to APIs after they have been released. If there is ever a need for drastic changes to the API, we would advance the API version to /v2, and /v1 would still be provided to support existing applications.

In the descriptions below, a term in the REST API preceded by a colon indicates that a specific name should be provided in that position. (This follows the conventions used by Node.js Express for REST calls.)

All the datastore API calls below will return an error code if the item being requested does not exist.

These are mostly GET calls. The few calls that are POST calls are noted as such.

Patient-centric API calls

The API calls in the section are detailed for medical imaging, using the DICOM concepts of studies containing series which contain individual images. However, the API has been structured to allow for the later inclusion of additional patient data types.

These REST calls support querying the datastore when there is a pipeline of algorithms, potentially having multiple executions and multiple outputs per pipeline step.

For REST calls having a “:result” argument, this may be a path for cases where the results of an algorithm may be indexed in different ways. For example, if an algorithm generates results as different features and may be run for different imaging modalities, the :result may be something like “modality/feature”.

For these calls, the primary object is the slide. For the case of tissue microarray (TMA) experiments, there can be tissue from many patients on the same slide.

Instances can be radiology images, pathology images, data files, or any other type of file.

Misc. REST API calls

AngularJS Services provided by rt106-app

This services can be used within a custom application within its AngularJS controller.

alarmService

The purpose of this service is to manage alarms and the internal state of Rt 106.

alarmService.displayAlert

Overview

Display an alarm in a pop-up window.

Usage

alarmService.displayAlert( message );

Arguments
Param Type Details
message string alert message to display

alarmService.scanForHealth

Overview

Query Rt 106 for any of its components that have failed its runtime health checks. Display an alert the first time a component is reported as bad.

Usage

alarmService.scanForHealth()

Arguments

(none)

dynamicDisplayService

The purpose of this service to support dynamically-generated result displays for an algorithm execution, based on the JSON metadata defined for that algorithm. The goal is to enable custom result displays in the user interface without the need to hard code those custom displays.

The capabilities here are just a limited start for the first Rt 106 release. The paradigm is that the result display will include up to four images arranged in a row or column (for two images) or a square (for four image).

dynamicDisplayService.displayInCell

Overview

Display the specified image (pathology image or DICOM series) in the appropriate image viewer with a given color & opacity value.

Usage

dynamicDisplayService.displayInCell( format, path, displayStructure, column, row, shape, color, opacity, imageProcessing, detections )

Arguments
Param Type Details
format string “http:” or “tiff16:”
path string path where image is stored in the datastore
displayStructure JSON metadata about how to display the image
column integer (0 or 1) which column to use (see dynamicDisplayService.setDisplayShape)
row integer (0 or 1) which row to use (see dynamicDisplayService.setDisplayShape)
shape string (see dynamicDisplayService.setDisplayShape)
color string e.g. ‘rgb(255,255,255)’
opacity number 0 to 1 opacity value
imageProcessing string If “toBinaryImage” the image will be binarized. More image processing operations can be added later.
detections list of detection points detections will be displayed on the rendered image

dynamicDisplayService.setDisplayShape

Overview

Set the result image display to be a single image, a row, a column, or a square.

Usage

dynamicDisplayService.setDisplayShape( shape )

Arguments
Param Type Details
shape string ‘1,1’ for single image
    ‘1,2’ for two images in a row
    ‘2,1’ for two images in a column
    ‘2,2’ for four images in a square

dynamicDisplayService.displayResult

Overview

Display the image results from an algorithm execution.

Usage

dynamicDisplayService.displayResult( executionItem, displayStructure, detections )

Arguments
Param Type Details
executionItem JSON metadata about the algorithm execution
displayStructure JSON metadata about how to display the image
detections list of detection points detections will be displayed on the rendered image

executionService

The purpose of this service is to manage algorithm executions and to maintain the execution list of past executions.

executionService.pollExecList

Overview

Poll rt106-server’s execution data to load rt106-app’s execution list.

Usage

executionService.pollExecList( execList, ngScope )

Arguments

|Param|Type|Details| |—–|—-|——-| |execList|JSON|the app’s current execution list, into which the new results will be merged| |ngScope|internal AngularJS structure|internal AngularJS structure, just used here to update the scrollbar in the user interface component that displays the execution list.|

executionService.initExecution

Overview

Initialize the executionService. Establish the connection between rt106-app and rt106-server, and tell rt106-server to initialize its execution list from past executions stored in the Rt 106 database.

Usage

executionService.initExecution()

Arguments

(none)

executionService.autofillRadiologyParameters

Overview

Automatically fill in certain input parameter values from user interface elements, specifically for radiology applications.

Usage

executionService.autofillRadiologyParameters( selectedParameters, selectedSeries )

Arguments

|Param|Type|Details| |—–|—-|——-| |selectedParameters|JSON|metadata describing the algorithm’s required parameters and their values from the user interface| |selectedSeries|string|path to currently-selected series|

executionService.autofillPathologyParameters

Overview

Automatically fill in certain input parameter values from user interface elements, specifically for pathology applications.

Usage

executionService.autofillPathologyParameters( selectedParameters, selectedSlide, selectedRegion, selectedChannel, selectedPipeline, forceOverwrite )

Arguments
Param Type Details
selectedParameters JSON metadata describing the algorithm’s required parameters and their values from the user interface
selectedSlide string currently-selected slide
selectedRegion string currently-selected region
selectedChannel string currently-selected channel
selectedPipeline string currently-selected pipeline
forceOverwrite boolean whether existing results should be overwritten

executionService.requestAlgoRun

Overview

Request an algorithm to run.

Usage

executionService.requestAlgoRun( selectedParameters, selectedAlgo )

Arguments

|Param|Type|Details| |—–|—-|——-| |selectedParameters|JSON|metadata describing the algorithm’s required parameters and their values from the user interface| |selectedAlgo|JSON|metadata describing the algorithm|

pathologyService

pathologyService.getSlideList

Overview

Get the list of slides.

Usage

pathologyService.getSlideList()

Arguments

(none)

pathologyService.getRegionList

Overview

Get the list of regions for a slide.

Usage

pathologyService.getRegionList( slide )

Arguments
Param Type Details
slide string name of a slide

pathologyService.getChannelList

Overview

Get the list of channels for a region on a slide.

Usage

pathologyService.getChannelList( slide, region )

Arguments

|Param|Type|Details| |—–|—-|——-| |slide|string|name of a slide| |region|string|name of region on the slide|

pathologyService.getPrimaryImagePath

Overview

Get the path for querying a pathology image.

Usage

pathologyService.getPrimaryImagePath( slide, region, channel )

Arguments

|Param|Type|Details| |—–|—-|——-| |slide|string|name of a slide| |region|string|name of region on the slide| |channel|string|name of a channel on a region on the slide

AngularJS Factories provided by rt106-app

analyticsFactory

analyticsFactory.getAnalytics()

Overview

Return a JSON structure describing all available algorithms including their classifications, inputs, parameters, expected results, and how result images should be displayed.

A JavaScript promise is returned.

Usage
analyticsFactory.getAnalytics().then(function(analytics) {
  // save or manipulate the analytics variable
});
Arguments

(none)

cohortFactory

cohortFactory.getPatients

Overview

Get the list of patients.

A JavaScript promise is returned.

Usage
cohortFactory.getPatients().then(function(patients) {
  // save or manipulate list of patients
})
.catch(function(reason){
  // handle error
});
Arguments

(none)

cohortFactory.getStudies

Overview

Get the list of studies for a patient.

A JavaScript promise is returned.

Usage
cohortFactory.getStudies(patient).then(function(studies) {
  // save or manipulate list of studies
})
.catch(function(reason){
  // handle error
});
Arguments

|Param|Type|Details| |—–|—-|——-| |patient|string|name of a patient|

cohortFactory.getSeries

Overview

Get the list of series for a patient and study.

A JavaScript promise is returned.

Usage
cohortFactory.getSeries(patient, study).then(function(series) {
  // save or manipulate list of series
})
.catch(function(reason){
  // handle error
});
Arguments

|Param|Type|Details| |—–|—-|——-| |patient|string|name of a patient| |study|string|name of a study for the patient|