Basic Structure of Boutiques Descriptors

A Boutiques descriptor is a JSON file with a specific structure. This page explains the core components and how they fit together.

Top-level Fields

Required Fields

FieldDescriptionExample
nameShort name of the tool"bet"
descriptionDetailed description of what the tool does"Automated brain extraction tool for FSL"
tool-versionVersion of the tool being described"6.0.4"
schema-versionVersion of the Boutiques schema"0.5"
command-lineTemplate for the command with placeholders"bet [INFILE] [MASKFILE] [OPTIONS]"
inputsArray of input parameters[{ "id": "infile", ... }]

Common Optional Fields

FieldDescriptionExample
authorAuthor of the tool"FMRIB Analysis Group, University of Oxford"
urlURL for the tool's documentation"https://fsl.fmrib.ox.ac.uk/fsl/fslwiki"
container-imageContainer configuration{ "type": "docker", "image": "..." }
output-filesArray of output files[{ "id": "outfile", ... }]
stdout-outputCapture stdout as an output{ "id": "stdout_data", ... }
stderr-outputCapture stderr as an output{ "id": "error_log", ... }

Unused Boutiques Fields

The following standard Boutiques fields are not currently used in the Styx ecosystem:

  • environment-variables: Environment variables to set
  • tests: Sample invocations for testing
  • online-platform-urls: URLs to platforms where tool is available
  • invocation-schema: Custom schema for tool-specific invocation validation
  • suggested-resources: Computational resources needed
  • tags: Categorization tags
  • error-codes: Tool-specific error codes
  • custom: Custom tool-specific metadata

Input Parameters

Input parameters define the arguments that can be passed to a tool. They're specified in the inputs array.

Common Parameter Fields

FieldDescriptionRequiredExample
idUnique identifier (alphanumeric + underscores)Yes"input_file"
nameHuman-readable nameYes"Input file"
descriptionDetailed descriptionNo"The input image in NIFTI format"
value-keyPlaceholder in command-line templateYes"[INPUT_FILE]"
optionalWhether parameter is requiredYestrue
command-line-flagCommand-line option prefixNo"-i"
default-valueDefault value if not specifiedNo"standard.nii.gz"
value-choicesArray of allowed valuesNo["small", "medium", "large"]

Parameter Types

Basic Types

TypeDescriptionAttributesExample
FileFile pathN/A{ "type": "File", "id": "input_image" }
StringText stringN/A{ "type": "String", "id": "output_prefix" }
NumberNumeric valueinteger: boolean, minimum, maximum{ "type": "Number", "integer": false, "minimum": 0, "maximum": 1 }
FlagBoolean flag (no value)N/A{ "type": "Flag", "id": "verbose" }

List Variants

Any basic type can be made into a list by adding "list": true:

{
  "id": "coordinates", 
  "type": "Number",
  "list": true,
  "min-list-entries": 3,
  "max-list-entries": 3
}

Optional list-related fields:

  • min-list-entries: Minimum number of elements required
  • max-list-entries: Maximum number of elements allowed
  • list-separator: Character(s) used to join list values (default is space)

Example with a custom separator:

{
  "id": "tags",
  "type": "String",
  "list": true,
  "list-separator": ","
}

This would result in a command-line argument like: --tags tag1,tag2,tag3

Command-Line Formation

The command-line is formed by replacing value-keys in the command-line template with actual parameter values.

Value Keys

Value keys connect parameters to positions in the command line. In the Styx ecosystem, they should:

  • Be enclosed in square brackets: [LIKE_THIS]
  • Use only uppercase letters, numbers, and underscores
  • Match exactly in the command-line template

Example:

"command-line": "bet [INFILE] [OUTFILE] [OPTIONS]",
"inputs": [
  {
    "id": "infile",
    "value-key": "[INFILE]",
    "type": "File"
  }
]

This replaces [INFILE] in the command-line with the actual file path.

Command-Line Flags

Command-line flags are specified with the command-line-flag field:

{
  "id": "verbose",
  "command-line-flag": "-v",
  "value-key": "[VERBOSE]",
  "type": "Flag"
}

For flags with values, you can control the separator between the flag and value:

{
  "id": "threshold",
  "command-line-flag": "--threshold",
  "command-line-flag-separator": "=",
  "value-key": "[THRESHOLD]",
  "type": "Number"
}

This would result in --threshold=0.5 rather than --threshold 0.5.

Output Files

Output files are defined in the output-files array. Unlike inputs, these aren't actually files passed to the command line but rather specifications of what files will be produced:

"output-files": [
  {
    "id": "brain_mask",
    "name": "Brain Mask Image",
    "description": "Binary mask of the brain",
    "path-template": "[OUTDIR]/[PREFIX]_mask.nii.gz",
    "optional": false
  }
]

The path-template uses the same value keys from inputs to construct the output path.

Common output file fields:

FieldDescriptionRequiredExample
idUnique identifierYes"brain_mask"
nameHuman-readable nameYes"Brain Mask Image"
descriptionDetailed descriptionNo"Binary mask of the brain"
path-templateTemplate for output file pathYes"[OUTPUT_DIR]/[PREFIX]_mask.nii.gz"
optionalWhether file might not be producedNotrue

Container Configuration

Container configurations help ensure reproducibility:

"container-image": {
  "type": "docker",
  "image": "brainlife/fsl:6.0.4-patched2"
}

In the Styx ecosystem, primarily the type and image fields are used, with Docker as the only container type.

Cross-References

Now that you understand the basic structure, learn more about:

  • Subcommands - For tools with complex structure and hierarchical parameters
  • File Handling - For detailed file input/output, path templates, and extension handling
  • Advanced Features - For command output capture, package configuration, and more
  • Troubleshooting - For common issues and their solutions
  • Examples - For complete descriptor examples showing these concepts in action