intro-to-mrtools

First steps with scripting

creating a view and basic get/set (video 6.1)

Assuming you have done the intial setup step with mrInit, you can script all the processing rather than using GUI interactions. For groups or participants, where all the scanning sessions have a consistent order, this will save you some time and also avoid errors that can get introduced by mistyping/clicking, etc.

(Note: There is also a way to script the initial step, but we’ll leave this for another unit/video).

To have a first look, try out the following lines of code (command line)

cd 20200721_demo
whos % check workspace is empty.
% close all, clear all % if not.

v = newView() 
viewGet(v, 'curscan')
viewGet(v, 'curgroup')

The code just above only does get operations - we are not actually changing the state of the view variable… but we can!

% assuming you have v from above
viewGet(v, 'curgroup')

running an analysis in a script (video 6.2)

Have a look at this script to see the steps in sequence / with some additional comments.

Helpful functions