Skip to content

Refactor example scripts for portability, implement basic automated testing - #161

Merged
jooh merged 58 commits into
automaticanalysis:masterfrom
jooh:master
Sep 17, 2018
Merged

Refactor example scripts for portability, implement basic automated testing#161
jooh merged 58 commits into
automaticanalysis:masterfrom
jooh:master

Conversation

@jooh

@jooh jooh commented Aug 15, 2018

Copy link
Copy Markdown
Collaborator

This is a big one! This pull request tries to achieve two major objectives, which I will cover first. Then I'll mention a few minor changes that have also crept into this PR.

I highly recommend that you check out this pull request locally and try running the tests. I have reorganised the repo a bit so it might also be more apparent how things look now by just checking it out for yourself.

Major changes

  1. Easier to get started with aa - the examples are shorter, have documentation, and should just run (famous last words) on a new machine, thanks to many under the hood changes to how AA defines file paths.

  2. Rudimentary automated testing that runs through the examples above.

To achieve this I added many under-the-hood features:

  • shell expansion in aarecipe - you can reference any shell $variable or $(expression) in any XML field, and the result will be evaluated at run-time.

  • aarecipe looks for aap_parameters_user.xml if no defaults.xml file is specified. If this file does not exist, aarecipe can generate it by asking the user to select one of the existing defaults as the parent.

  • default aap.acq_details.root - use the above functionality to place data in sensible default locations ($HOME/aa in defaults.xml, /imaging/$USER/aa in defaults_CBSU.xml).

  • We now setenv an SPMDIR shell variable to make it easy to reference SPM-relative paths in defaults and tasklists, using the above expansion functionality.

  • BIDS import improvements: select custom events.tsv column for first-level model regressor definition, select sub-set of subjects.

  • handy function for automatically downloading the aa demo dataset from Rhodri's S3 storage, if it's needed.

Minor changes

  • all roi_extract modules now expect input from the rois stream instead of the ROIFile option. This makes AA more modular and flexible. You will need to modify user scripts by adding aas_addinitialstream.

  • quieter, less repetitive logging, especially when using aas_shell

  • new modules to reorient nifti header dimensions to the format expected by fslview and similarly stupid viewers.

  • Update CBSU default with new version of various toolboxes. Lock versions to specific versions rather than referencing 'latest' for greater reproducibility. Set more sensible defaults (e.g., numdummies should arguably default to 0).

  • removed old code: aa_config, aas_configforSPM12, many old examples.

  • tidy-up - change all file endings and line breaks to unix.

  • tidy-up - co-locate example user scripts and tasklists in the example folder. I think this makes more sense since these files are used together only.

  • update readme to be somewhat more current.

jooh added 30 commits July 26, 2018 14:24
Conflicts:
	aa_recipes_and_parametersets/aap_parameters_defaults_CBSU.xml
…input in place of ROIfile setting for greater flexibility, update MTI example
1. aarecipe now creates a new seed aap_parameters_user.xml file if no
defaults file is specified. This put user-specific configuration outside of
version control (where it should be).

2. The example scripts all call aarecipe without a defaults file, so
that the above functionality makes it possible to run tests regardless
of site (as long as the data is publicly available).

3. aa_test/aatest - new test function for running tests on the above
examples in an automated manner.

4. Re-organised the examples directory for clarity and to make it
possible to run particular test flavours (e.g., all CBU-specific tests
are under the cbu folder). Added light-weight documentation for this.

5. Big tidy up of legacy examples.

6. Relocated the task lists to the examples directory, and renamed to
always match the user script it goes with. Renamed
aa_recipes_and_parametersets aa_parametersets to reflect this change
(this directory only contains defaults now).
This was referenced Aug 17, 2018
@jooh
jooh merged commit 6639fc2 into automaticanalysis:master Sep 17, 2018
@tiborauer

Copy link
Copy Markdown
Member

Why did you merged it if #163 also contained it?

@tiborauer

Copy link
Copy Markdown
Member

I see now!:)

@jooh

jooh commented Sep 17, 2018

Copy link
Copy Markdown
Collaborator Author

Github magic!

jones-michael-s pushed a commit to jones-michael-s/automaticanalysis that referenced this pull request Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants