pipeline

pipeline Package

This pipeline module includes the following workflows:

  • qipipe.pipeline.qipipeline: the soup-to-nuts pipeline to stage, mask, register and model new images
  • qipipe.pipeline.staging: executes the staging workflow to detect new images, group them by volume, import them into XNAT and prepare them for TCIA import
  • qipipe.pipeline.mask: creates a mask to subtract extraneous tissue from the input images
  • qipipe.pipeline.registration: masks the target tissue and corrects motion artifacts
  • qipipe.pipeline.modeling: performs pharmokinetic modeling

mask

modeling

pipeline_error

exception qipipe.pipeline.pipeline_error.PipelineError

Bases: exceptions.Exception

The common pipeline error class.

qipipeline

registration

roi

staging

workflow_base

class qipipe.pipeline.workflow_base.WorkflowBase(name, **opts)

Bases: object

The WorkflowBase class is the base class for the qipipe workflow wrapper classes.

If the distributable flag is set, then the execution is distributed using the Nipype plug-in specified in the configuration plug_in parameter.

The workflow plug-in arguments and node inputs can be specified in a qiutil.ast_config.ASTConfig file. The configuration directory order consist of the order consist of the search locations in low-to-high precedence order consist of the following:

  1. the qipipe module conf directory
  2. the config_dir initialization keyword option

The common configuration is loaded from the default.cfg file or in the directory locations. The workflow-specific configuration file name is the lower-case name of the WorkflowBase subclass with .cfg extension, e.g. registration.cfg for qipipe.workflow.registration.RegistrationWorkflow. The configuration settings are then loaded from the common configuration files followed by the workflow-specific configuration files.

Initializes this workflow wrapper object. The parent option obviates the other options.

Parameters:
  • name – the module name
  • opts – the following keyword arguments:
  • project – the project
  • parent – the parent workflow for a child workflow
  • base_dir – the base_dir
  • config_dir – the optional workflow node configuration file location or dictionary
  • dry_run – the dry_run flag
  • distributable – the distributable flag
Raises:

PipelineError – if there is neither a project nor a parent argument

INTERFACE_PREFIX_PAT = <_sre.SRE_Pattern object>

Regexp matcher for an interface module.

Example:

>>> from qipipe.pipeline.workflow_base import WorkflowBase
>>> WorkflowBase.INTERFACE_PREFIX_PAT.match('nipype.interfaces.ants.util.AverageImages').groups()
('nipype.',)
MODULE_PREFIX_PAT = <_sre.SRE_Pattern object>

Regexp matcher for a module prefix.

Example:

>>> from qipipe.pipeline.workflow_base import WorkflowBase
>>> WorkflowBase.MODULE_PREFIX_PAT.match('ants.util.AverageImages').groups()
('ants.', 'ants.', 'util.', 'AverageImages')
>>> WorkflowBase.MODULE_PREFIX_PAT.match('AverageImages')
None
__init__(name, **opts)

Initializes this workflow wrapper object. The parent option obviates the other options.

Parameters:
  • name – the module name
  • opts – the following keyword arguments:
  • project – the project
  • parent – the parent workflow for a child workflow
  • base_dir – the base_dir
  • config_dir – the optional workflow node configuration file location or dictionary
  • dry_run – the dry_run flag
  • distributable – the distributable flag
Raises:

PipelineError – if there is neither a project nor a parent argument

base_dir = None

The workflow execution directory (default a new temp directory).

config_dir = None

The workflow node inputs configuration directory.

configuration = None

The workflow node inputs configuration.

depict_workflow(workflow)

Diagrams the given workflow graph. The diagram is written to the name.dot.png in the workflow base directory.

:param workflow the workflow to diagram

dry_run = None

Flag indicating whether to prepare but not run the workflow.

is_distributable = None

Flag indicating whether to submit jobs to a cluster.

logger = None

This workflow’s logger.

project = None

The XNAT project name.