Designing Apps¶
Command definitions¶
The XNAT container service uses command configuration files
saved in the org.nrg.commands image label to resolve metadata for the pipelines
that available on a given Docker image. The XnatViaCS.generate_xnat_command()
method is used to generate the JSON metadata to be saved in this field.
There are four key fields that will determine the functionality of the command (the rest are metadata fields that are exposed to the XNAT UI):
task
inputs
outputs
parameters
The task
keyword argument should be the path to an installed
Python module containing a Pydra task followed by a colon and the name of
the task, e.g. pydra.tasks.fsl.preprocess.fast:Fast
. Note that Arcana
will attempt to resolve the package that contains the Pydra task and install the
same version (including local development versions) within the Anaconda environment
in the image. inputs
and parameters
expose text boxes in the XNAT dialog when
the pipelines are run. outputs
determine where the outputs will
be stored in the XNAT data tree.
Inputs prompt the user to enter selection criteria for input data and are used by the entrypoint of the Docker containers to add source columns to the frameset (see FrameTree). They are specified by 4-tuple consisting of
name of field in the pydra task input interface
datatype required by pydra task
description of input that will be exposed to the XNAT UI
the row row_frequency of the column (see FrameTree)
Parameters are passed directly through the pipeline add method (see FrameTree) that is run in the container, and consist of a 2-tuple with
name of field in the pydra task input interface
description of parameters that will be exposed to the XNAT UI
Outputs do not show up in the XNAT dialog and are specified by a 3-tuple:
name of field in the pydra task output interface
datatype produced by pydra task
destination path (slashes are permitted interpreted as a relative path from the derivatives root)
When working with the CLI, command configurations are stored in YAML format,
with keys matching the arguments of XnatViaCS.generate_xnat_command()
.
Note
image_tag
and registry
are omitted from the YAML representation
of the commands as they are provided by the image configuration
(see Building)