Skip to content
rhodricusack edited this page Mar 25, 2012 · 1 revision

aa4 builds a precise description of what data is needed by each module, and what outputs it produces. It does this using the concept of "streams". In a module's .xml file, it specifies what inputs it needs like this:

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

It then specifies its outputs like this

          <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. Within their matlab code, modules can fetch a list of the files that correspond to a given stream using lines like this:
 structfn=aas_getfiles_bystream(aap,subjnum,'structural');

They then specify their outputs using lines like this:

 aap=aas_desc_outputs(aap,subjnum,'structural',newstructfn);

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.

List of 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

Streams may contain be input and output by many modules. The "epi" data, for example is passed along through all of the modules in the preprocessing. It changes in form along the way - being motion corrected, for example, or normalised. The advantage of a common name for all of these different 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 other streams - check the <inputstreams></inputstreams> and <outputstreams></outputstreams> sections of the .xml files of the modules.

Clone this wiki locally