Aa Scripting SPM analyses using aa Rhodri Cusack.

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

Buttons in SPM5 Carolyn McGettigan & Alice Grogan Methods for Dummies 5 th April 2006.
MASTER QUOTE OVERVIEW.
EMIS Web Sorting out RBAC.
Premier Director Document Imaging
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
SPM5 Tutorial, Part 1 fMRI preprocessing Tiffany Elliott May
HORIZONT 1 ProcMan ® The Handover Process Manager Product Presentation HORIZONT Software for Datacenters Garmischer Str. 8 D München Tel ++49(0)89.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
PayDox applications All features can be used independently.
Apache : Installation, Configuration, Basic Security Presented by, Sandeep K Thopucherela, ECE Department.
Installing software on personal computer
BIAF Print Label software setup
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
Linux Operations and Administration
Programming For Nuclear Engineers Lecture 12 MATLAB (3) 1.
Programmer Defined Functions Matthew Verleger. Windows It’s estimated that Window’s XP contains 45 million lines of code (and it’s over 10 years old).
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
SCRAM Software Configuration, Release And Management Background SCRAM has been developed to enable large, geographically dispersed and autonomous groups.
Systems Analysis – Analyzing Requirements.  Analyzing requirement stage identifies user information needs and new systems requirements  IS dev team.
1 Shawlands Academy Higher Computing Software Development Unit.
Advanced Excel for Finance Professionals A self study material from South Asian Management Technologies Foundation.
What is Sure BDCs? BDC stands for Batch Data Communication and is also known as Batch Input. It is a technique for mass input of data into SAP by simulating.
Operating Systems. Operating System  A program running in a computer from the moment it is switched on.  Part of the Systems Software of the computer.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
 To explain the importance of software configuration management (CM)  To describe key CM activities namely CM planning, change management, version management.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
11 MANAGING AND DISTRIBUTING SOFTWARE BY USING GROUP POLICY Chapter 5.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Tutorial build Main ideas –Reuse as much previously obtained configuration information as possible: from Babel, cca-spec-babel, etc. –Extract all irrelevant.
…using Git/Tortoise Git
The Professional Open Source™ Company CLI Shell JBossNetwork Enterprise Manager Command Line Interface.
Software Project Planning Defining the Project Writing the Software Specification Planning the Development Stages Testing the Software.
OHTO -99 SOFTWARE ENGINEERING “SOFTWARE PRODUCT QUALITY” Today: - Software quality - Quality Components - ”Good” software properties.
The european ITM Task Force data structure F. Imbeaux.
Managing SX.e and TWL with MARC and Scripts Jeremiah Curtis
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
Chapter Two Exploring the UNIX File System and File Security.
Sequence Automation. 2 In This Section, We Will Discuss:  How to set up a sequence.  How to perform automated recalibrations.  How to do bracketing.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
Guide to Linux Installation and Administration, 2e1 Chapter 11 Using Advanced Administration Techniques.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
The Software Development Process
Overview of the Automated Build & Deployment Process Johnita Beasley Tuesday, April 29, 2008.
Fall 2011 Nassau Community College ITE153 – Operating Systems Session 21 Administering User Accounts and Groups 1.
FEAT (fMRI Expert Analysis Tool)
INFSO-RI Enabling Grids for E-sciencE Charon Extension Layer. Modular environment for Grid jobs and applications management Jan.
Methods for Dummies Second level Analysis (for fMRI) Chris Hardy, Alex Fellows Expert: Guillaume Flandin.
Lab 8 Overview Apache Web Server. SCRIPTS Linux Tricks.
ENG College of Engineering Engineering Education Innovation Center 1 Functions 1 in MATLAB Topics Covered: 1.Uses of Functions Organizational Tool.
Project Planning Defining the project Software specification Development stages Software testing.
EValid LoadTest, eV.manger and Validation. Agenda Load Test capability of eValid How to execute load test by using eValid Introduction to eV.manager Validation.
File System Security in Unix Annie Calpe. Overview Unix Basics File System Security: - Account Security: Passwords - File Permissions - Access Control.
Sequencia Partner Tools 20 Minute OpenBatch Review 20 Minute OpenBatch Review Page: 1 3_21_ISA8895_Function_PhysicalProcessControl_OpenBatch_v2_en.pptx.
XINFO HORIZONT Scheduler migration support Software for Datacenters
Navigating the Filing System
Matlab Training Session 4: Control, Flow and Functions
Pipeline Execution Environment
Software Testing With Testopia
Maintaining software solutions
© Paradigm Publishing, Inc.
Dreaming of a Paperless Office
SiteBuilder 2 Introduction.
This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational.
Lab 8: GUI testing Software Testing LTAT
AtlasSetup & Evolution
Presentation transcript:

aa Scripting SPM analyses using aa Rhodri Cusack

aa Automates analysis of neuroimaging data using SPM. Automatic Advantages over simple batch systems Restartable Hierarchical & modular, e.g., “recipes” Well behaved Record keeping Modules have simple interface Easy to start using & to keep up to date Two versions: one for SPM 5 & the new scanner, and one for SPM 2 and the old scanner Popular! 34/34 users that expressed a preference (actually, that have analyzed data from CBU scanner on Linux systems, and have not blocked disc access) 34/34 aa

Typical user script % Automatic analysis % User master script % Rhodri Cusack MRC CBU Cambridge 2006 % (1) RESET ALL PARAMETERS aap=[]; % (2) ANALYSIS RECIPE % General auto TR recipe; slice order Siemens product sequence default aap=aarecipe_general_withmodel_ver02(aap); % (3) MODIFY STANDARD RECIPE MODULE SELECTION HERE IF YOU'D LIKE % do this here % (4) GET ALL THE PARAMETERS FOR THIS RECIPE aap=aa_init(aap); % (5) DEFINE STUDY SPECIFIC PARAMETERS aap.options.aa_minver=1.0; % will only work on aa version 1.0 or above % The study directory aap.acq_details.root = '/imaging/rhodri/aa_demo'; % Add subjects and session numbers for EPI data aap=aas_addsubject(aap,'*CBU050011/*',[5 11]); % Condition names for each session, must be same for all subjects aap.acq_details.sessions={'mystery1','mystery2'}; % Number of dummy scans at the start of each session aap.acq_details.numdummies=18; % Slice acquisition order aap.spmanalysis.sliceorder=[32:-1:1]; % 32 descending % (6) SET ANY OTHER PARAMETERS YOU WOULD LIKE TO BE DIFFERENT FROM THE DEFAULTS % (7) SET ANY SPM DEFAULTS IF NEEDED % (8) DO PROCESSING aa_doprocessing(aap);

aa Recipes currently available

aa Typical user script % Automatic analysis % User master script % Rhodri Cusack MRC CBU Cambridge 2006 % (1) RESET ALL PARAMETERS aap=[]; % (2) ANALYSIS RECIPE % General auto TR recipe; slice order Siemens product sequence default aap=aarecipe_general_withmodel_ver02(aap); % (3) MODIFY STANDARD RECIPE MODULE SELECTION HERE IF YOU'D LIKE % do this here % (4) GET ALL THE PARAMETERS FOR THIS RECIPE aap=aa_init(aap); % (5) DEFINE STUDY SPECIFIC PARAMETERS aap.options.aa_minver=1.0; % will only work on aa version 1.0 or above % The study directory aap.acq_details.root = '/imaging/rhodri/aa_demo'; % Add subjects and session numbers for EPI data aap=aas_addsubject(aap,'*CBU050011/*',[5 11]); % Condition names for each session, must be same for all subjects aap.acq_details.sessions={'mystery1','mystery2'}; % Number of dummy scans at the start of each session aap.acq_details.numdummies=18; % Slice acquisition order aap.spmanalysis.sliceorder=[32:-1:1]; % 32 descending % (6) SET ANY OTHER PARAMETERS YOU WOULD LIKE TO BE DIFFERENT FROM THE DEFAULTS % (7) SET ANY SPM DEFAULTS IF NEEDED % (8) DO PROCESSING aa_doprocessing(aap);

aa File structure

aa Typical user script % Automatic analysis % User master script % Rhodri Cusack MRC CBU Cambridge 2006 % (1) RESET ALL PARAMETERS aap=[]; % (2) ANALYSIS RECIPE % General auto TR recipe; slice order Siemens product sequence default aap=aarecipe_general_withmodel_ver02(aap); % (3) MODIFY STANDARD RECIPE MODULE SELECTION HERE IF YOU'D LIKE % do this here % (4) GET ALL THE PARAMETERS FOR THIS RECIPE aap=aa_init(aap); % (5) DEFINE STUDY SPECIFIC PARAMETERS aap.options.aa_minver=1.0; % will only work on aa version 1.0 or above % The study directory aap.acq_details.root = '/imaging/rhodri/aa_demo'; % Add subjects and session numbers for EPI data aap=aas_addsubject(aap,'*CBU050011/*',[5 11]); % Condition names for each session, must be same for all subjects aap.acq_details.sessions={'mystery1','mystery2'}; % Number of dummy scans at the start of each session aap.acq_details.numdummies=18; % Slice acquisition order aap.spmanalysis.sliceorder=[32:-1:1]; % 32 descending % (6) SET ANY OTHER PARAMETERS YOU WOULD LIKE TO BE DIFFERENT FROM THE DEFAULTS % (7) SET ANY SPM DEFAULTS IF NEEDED % (8) DO PROCESSING aa_doprocessing(aap);

aa Typical user script % Automatic analysis % User master script % Rhodri Cusack MRC CBU Cambridge 2006 % (1) RESET ALL PARAMETERS aap=[]; % (2) ANALYSIS RECIPE % General auto TR recipe; slice order Siemens product sequence default aap=aarecipe_general_withmodel_ver02(aap); % (3) MODIFY STANDARD RECIPE MODULE SELECTION HERE IF YOU'D LIKE % do this here % (4) GET ALL THE PARAMETERS FOR THIS RECIPE aap=aa_init(aap); % (5) DEFINE STUDY SPECIFIC PARAMETERS aap.options.aa_minver=1.0; % will only work on aa version 1.0 or above % The study directory aap.acq_details.root = '/imaging/rhodri/aa_demo'; % Add subjects and session numbers for EPI data aap=aas_addsubject(aap,'*CBU050011/*',[5 11]); % Condition names for each session, must be same for all subjects aap.acq_details.sessions={'mystery1','mystery2'}; % Number of dummy scans at the start of each session aap.acq_details.numdummies=18; % Slice acquisition order aap.spmanalysis.sliceorder=[32:-1:1]; % 32 descending % (6) SET ANY OTHER PARAMETERS YOU WOULD LIKE TO BE DIFFERENT FROM THE DEFAULTS % (7) SET ANY SPM DEFAULTS IF NEEDED % (8) DO PROCESSING aa_doprocessing(aap);

aa Typical user script % Automatic analysis % User master script % Rhodri Cusack MRC CBU Cambridge 2006 % (1) RESET ALL PARAMETERS aap=[]; % (2) ANALYSIS RECIPE % General auto TR recipe; slice order Siemens product sequence default aap=aarecipe_general_withmodel_ver02(aap); % (3) MODIFY STANDARD RECIPE MODULE SELECTION HERE IF YOU'D LIKE % do this here % (4) GET ALL THE PARAMETERS FOR THIS RECIPE aap=aa_init(aap); % (5) DEFINE STUDY SPECIFIC PARAMETERS aap.options.aa_minver=1.0; % will only work on aa version 1.0 or above % The study directory aap.acq_details.root = '/imaging/rhodri/aa_demo'; % Add subjects and session numbers for EPI data aap=aas_addsubject(aap,'*CBU050011/*',[5 11]); % Condition names for each session, must be same for all subjects aap.acq_details.sessions={'mystery1','mystery2'}; % Number of dummy scans at the start of each session aap.acq_details.numdummies=18; % Slice acquisition order aap.spmanalysis.sliceorder=[32:-1:1]; % 32 descending % (6) SET ANY OTHER PARAMETERS YOU WOULD LIKE TO BE DIFFERENT FROM THE DEFAULTS % (7) SET ANY SPM DEFAULTS IF NEEDED % (8) DO PROCESSING aa_doprocessing(aap);

aa Typical user script % Automatic analysis % User master script % Rhodri Cusack MRC CBU Cambridge 2006 % (1) RESET ALL PARAMETERS aap=[]; % (2) ANALYSIS RECIPE % General auto TR recipe; slice order Siemens product sequence default aap=aarecipe_general_withmodel_ver02(aap); % (3) MODIFY STANDARD RECIPE MODULE SELECTION HERE IF YOU'D LIKE % do this here % (4) GET ALL THE PARAMETERS FOR THIS RECIPE aap=aa_init(aap); % (5) DEFINE STUDY SPECIFIC PARAMETERS aap.options.aa_minver=1.0; % will only work on aa version 1.0 or above % The study directory aap.acq_details.root = '/imaging/rhodri/aa_demo'; % Add subjects and session numbers for EPI data aap=aas_addsubject(aap,'*CBU050011/*',[5 11]); % Condition names for each session, must be same for all subjects aap.acq_details.sessions={'mystery1','mystery2'}; % Number of dummy scans at the start of each session aap.acq_details.numdummies=18; % Slice acquisition order aap.spmanalysis.sliceorder=[32:-1:1]; % 32 descending % (6) SET ANY OTHER PARAMETERS YOU WOULD LIKE TO BE DIFFERENT FROM THE DEFAULTS % (7) SET ANY SPM DEFAULTS IF NEEDED % (8) DO PROCESSING aa_doprocessing(aap);

aa The hierarchy user script –purpose: to set up aap structure, which describes processing to be done recipes –describe a default processing pipeline –in fact, just specify a group of parameter sets aap_directory_conventions_ver00 aap_tasklist_withmodel_ver00... modules –initialisation modules run at start of each processing run aamod_evaluatesubjectnames –main modules only run once (per study/ subject/ session) aamod_realign... helper functions –helper functions aas_getsubjpath aas_getsesspath aas_getimages... engine –main tools aa_doprocessing aa_report... on site off site during installation

aa Checking output Although processing happens automatically it is VITAL THAT YOU CHECK YOUR DATA at various stages of processing You should do this in the normal way with SPM aa provides two ways to help you further –diagnostic jpeg images tsdiffana motion correction coreg normalisation undistortion –aa_report function After analysis, type –aa_report(‘study root path’) –Or aa_report if already in study root Use version of aa that original analysis was run with –aa_ver1_devel and aa_ver11 incompatible

aa First level model & contrasts At present, if you wish to automate first level (single subject) modelling, you must modify these modules: –aamod_firstlevel_model –aamod_firstlevel_contrasts Simple second level models will then run automatically –one-sample t-test for each contrast at first level Next day results!

aa Documentation wiki matlab reference

aa Installation outside CBU

aa Other features Benchmarking –After analysis, type aa_benchmark(‘study root path’) Or aa_benchmark if already in study root

aa Adding or overriding modules You may add a new component –Place in same directory as aa_user script, or in your matlab path …or override an existing one –As above, but give it the same name as the component you’re overriding Type which [commandname] (e.g., which aamod_realign) to find out which version of a function you are currently using Naming conventions Modulesaamod_ Recipesaarecipe_ Parameter sets (tasklists etc…)aap_ Engineaa_ Helper subroutinesaas_

aa aap_tasklist_general_ver02 % Automatic analysis % Rhodri Cusack MRC CBU Cambridge % aap_tasklist_general_ver02 function [aap]=aap_tasklist_general_ver02(aap) % these initialisation modules are always run at the start of a batch script run aap.tasklist.initialisationmodules={'aamod_checkparameters','aamod_evaluatesubjectnames','aamod_make_sub jects_short','aamod_autoidentifyseries_timtrio'}; % EPI file prefix definitions now moved here as depends so strongly on % tasklist - second parameter for functions that have EPI input, blank if not aap.tasklist.epiprefix=[];% reset prefix list aap.tasklist.stages=[];% reset list of stages aap=aas_addtask(aap,'aamod_study_init'); aap=aas_addtask(aap,'aamod_newsubj_init'); aap=aas_addtask(aap,'aamod_converttmaps'); aap=aas_addtask(aap,'aamod_copystructural'); aap=aas_addtask(aap,'aamod_convert_epis'); aap=aas_addtask(aap,'aamod_tsdiffana','f'); aap=aas_addtask(aap,'aamod_realign','f'); aap=aas_addtask(aap,'aamod_slicetiming','rf'); aap=aas_addtask(aap,'aamod_coreg_noss','arf'); aap=aas_addtask(aap,'aamod_norm_noss','arf'); aap=aas_addtask(aap,'aamod_norm_write','arf'); aap=aas_addtask(aap,'aamod_smooth','warf');

aa Structure of modules % AA module - smoothing % Kernel size determined by aap.spm_analysis.FWHM % Rhodri Cusack MRC CBU Cambridge Jan 2006 function [aap,resp]=aamod_smooth(aap,task,i) resp=''; switch task case 'domain' resp='subject'; % this module needs to be run once per subject case 'description' resp='SPM5 smooth'; case 'summary' subjpath=aas_getsubjpath(i); resp=sprintf('Smooth run on %s\n',subjpath); case 'report' case 'doit' % get the subdirectories in the main directory subj_dir = aas_getsubjpath(aap,i); … case 'checkrequirements' otherwise aas_log(aap,1,sprintf('Unknown task %s',task)); end;

aa Writing your own modules - helper functions Getting subject path subjpth=aas_getsubjpath(aap,subjnum); Getting session path sesspth=aas_getsesspath(aap,subjnum,sessnum); Getting EPI images with particular prefix imagefns=aas_getimages(aap,subjnum,sessnum,prefixes,minimg,maximg) e.g., aas_getimages(aap,1,3,’wra’); Finding files fn=aas_findfiles(aap,’/imaging/rhodri/blah*/blah.nii’); Running shell command fn=aas_shell(’ls’);

aa Summary Using aa to script SPM analyses is popular –Easy-to-use –Robust –Encourages efficient practice –Easy to extend