AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
November 06, 2022 08:40PM
Hi, Sebastien-

Yes: start the GUI, and arrange it as you want.

Then click on "Define Datamode" (in the 2nd column of the GUI, middle-ish). Then in the menu that opens, click on Misc in the bottom row. Then click on "Save Layout"---I usually then just hit Set select the default file name ".afni.startup_script", and a file of that name will reside in your directory where AFNI was started. Hence after, by default that file will get read, and fire up locations, sizes and types of windows to open at the moment of file creation.

You can also set an environment variable in your ~/.afnirc file and put that file in a location where it is always read (home directory, say):
--------------------------
Variable: AFNI_LAYOUT_FILE
--------------------------
If defined, this variable is the name of a file to read at startup
to define the "layout" of AFNI windows at the program start. If
this name starts with a '/' character, then it is an absolute path;
otherwise, it is taken to be a path relative to the user's home
directory ($HOME). If the AFNI command line switch "-layout" is
used, it will override this specification.

The simplest way to produce a layout file is to use the "Save Layout"
button on the Datamode->Misc menu. You can then edit this file;
the format should be fairly self-explanatory. The structure of the
file is similar to the .afnirc file (cf. README.setup). In fact,
the layout file can be included into .afnirc (since it is just another
*** section) and then setting AFNI_LAYOUT_FILE = .afnirc in the
***ENVIRONMENT section should work.

A sample layout file:

***LAYOUT
 A               geom=+73+1106                 // start controller A
 A.sagittalimage geom=320x320+59+159 ifrac=0.8 // and Sagittal image
 A.sagittalgraph geom=570x440+490+147 matrix=9 // and Sagittal graph
 B                                             // start controller B
 B.plugin.ROI_Average                          // start a plugin

Each window to be opened has a separate command line in this file.
The "geom=" qualifiers specify the size and position of the windows.
For images, "ifrac=" can be used to specify the fraction of the window
occupied by the image (if "ifrac=1.0", then no control widgets will be
visible). For graphs, "matrix=" can be used to control the initial
number of sub-graphs displayed. For plugins, the label on the button
that starts the plugin is used after the ".plugin." string (blanks
should be filled with underscores "_"). In the example above, the last
two windows to be opened do not have a "geom=" qualifier, so their
placement will be chosen by the window manager.

If you add "slow" after the "***LAYOUT", then each window operation
will be paused for 1 second to let you watch the layout operations
proceed gradually. Otherwise, they will be executed as fast as
possible (which still may not be all that fast).

Using layouts with a window manager that requires user placement
of new windows (e.g., twm) is a futile and frustrating exercise.

If you do NOT have any layout file defined, then AFNI will choose
a layout for you that includes opening image viewers. Some people
find this very annoying. The simplest way to avoid this annoyance
is to set AFNI_LAYOUT_FILE to a name of a file that doesn't exist
(e.g., 'ElvisIsAliveOnPlanetZork'). The reason for this default
layout behavior (added Dec 2010) is that we received complaints
that novice users were finding AFNI too confusing on startup.
(Hard to believe, but true.)
... from this page:
[afni.nimh.nih.gov]

--pt
Subject Author Posted

automatic afni image and graph window layout Attachments

Sébastien Proulx November 06, 2022 06:54PM

Re: automatic afni image and graph window layout

ptaylor November 06, 2022 08:40PM