Skip to content

Stream reference

Mike Jones edited this page Apr 22, 2022 · 6 revisions

The Stream Concept

Automatic Analysis uses an abstraction of the data processed by each module called a stream. This includes both the input required by a module and the output it generates.

In a module's .xml file, inputs are specified as inputstreams:

          <inputstreams>
              <stream>epi</stream>  
          </inputstreams>

Module outputs are specified as a list of outputstreams:

          <outputstreams>
              <stream>realignment_parameter</stream>
              <stream>meanepi</stream>
              <stream>epi</stream>
          </outputstreams>
aa uses this to calculate which modules are dependent on which other modules.

Qualified stream inputs

You may not always want the input stream to come from the last module that output it. Sometimes, for example, you might want to get the epis from an earlier stage, or to compare the epis before and after a given stage.

You may now set up more complex pipelines by qualifying inputs to a module in the xml (or programatically) like this:

<inputstreams>
    <stream>aamod_realign00001.epi</stream>
</inputstreams>
Within the module, you may refer to the stream either by its qualified name (useful if there is more than one - say epis from to different stages) or by its abbreviated name (just epi) if there is only one.

Some example streams

Stream name Description Input to, e.g., Output from, e.g.,
epi fMRI data - many EPI volumes aamod_realign aamod_realign
structural anatomical image aamod_norm_noss aamod_norm_noss
realignment_parameter text file containing motion estimates aamod_firstlevel_model aamod_realign
meanepi mean epi aamod_coreg_noss aamod_realign

The same stream can be both input to and output from a module. For example, the "epi" stream is passed through many of the modules in the preprocessing. The underlying data changes along the way - being motion corrected, for example, or normalised. However the streamname remains 'epi' throughout. An advantage of using a common name across stages is that it makes it easy to reorder your modules - to execute a model on the unnormalised rather than normalised data, for example, just by putting aamod_firstlevel_module before aamod_norm_write.

There are many streams used in aa modulues - see the inputstreams and outputstreams blocks in the module .xml headers for examples.

Clone this wiki locally