Thanks, rick! This is really cool!
In case someone else is also interested in similar functionality, here is my current approach:
After opening multiple afni controllers, I save my multi-controller layout (as well as underlay, overlay, color, threshold, etc. associated with each controller) by:
Define Datamode > Misc > Save Layout > layout01.script (N.B.: file name must contain "script")
And then reload this layout by:
$ load_layout.py layout01.script
With the help of a short custom python script "load_layout.py":
-------------------------------------------------------------------------------------
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys, subprocess
if __name__ == '__main__':
afni_script = sys.argv[1]
with open(afni_script) as f:
lines = f.readlines()
com = '; '.join([line.strip() for line in lines if not line.startswith('//')]);
subprocess.call('afni -com "CLOSE_WINDOW A.axialimage; \
CLOSE_WINDOW A.sagittalimage; CLOSE_WINDOW A.coronalimage" \
-com "{0}"'.format(com), shell=True)
-------------------------------------------------------------------------------------
For more information, check
plugout_drive as a demo plugout as well as a tool
"-com" option of afni
All available commands