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  

|
August 25, 2021 10:27AM
To be clear, you want to compute separate betas for each run, for the onset_C_test.txt file, where each row has the stim timings for one run? But for the other stim files, the betas are for all runs and you are cool with that?

If the answer to both questions is YES, then you have to split onset_C_test.txt into 16 separate files. There are two reasons:
  1. The timing file for EACH -stim_times option must have 16 rows, one for each run.
  2. Unlike most options that take .1D files, the "ragged" input for -stim_times does not allow row {} or column [] selectors. Here, "ragged" means that the same number of entries are not required in each row, unlike the more common (and earlier in time) .1D file format.
Another minor point is that row (and column) selectors start at 0, not at 1 -- but since they are not allowed here anyway, that is not a direct problem with your command as shown.

Rick Reynolds' program timing_tool.py can do this splitting up for you, with a little preliminary effort on your part. For your particular application, you will first have to make a "partition" file, which contains the number "1" n times in the first row (where "n" is the number of stimuli per row), the number "2" n times in the second row, the number "3" n times in the third row, etc. -- up to the number "16" n times in the 16th row.

For a smaller example, suppose the following is your timing file qqq.txt (n=6 entries per row, 3 rows=3 runs):
1 2 3 4 5 6
11 12 13 14 15 16
21 22 23 24 25 26
To create a partition file qpp.txt, here is a C shell (tcsh) mini-script, using the system command "jot" -- for bash, you'll have to change the looping:
foreach jjj ( `jot 3 1 3` )
   jot -s " " 6 $jjj $jjj >> qpp.txt
end
In the above, the two "3"s are the number of rows, while the "6" is the number of entries per row.
Here is what qpp.txt looks like
1 1 1 1 1 1
2 2 2 2 2 2
3 3 3 3 3 3
Then the command
timing_tool.py -timing qqq.txt -partition qpp.txt qnew
will produce 3 files (1 for each input row, which is 1 for each distinct value in qpp.txt), named qnew_1.txt, qnew_2.txt, and qnew_3.txt. Here is the middle one of these:
* *
11 12 13 14 15 16 
* *
As you can see, there are 3 lines in this file; however, all but the second line have only asterisks, which are placeholders for "nothing to see here" -- that is, there must be 3 lines because there are 3 runs, but this stimulus class only occurs in run #2, so you need placeholders for the non-existent stimuli in the other runs.

For a little more detail, see the timing_tool.py -help output.
Subject Author Posted

How to extract run-wise beta value for each condition

Mpark August 25, 2021 03:23AM

Re: How to extract run-wise beta value for each condition

RWCox August 25, 2021 10:27AM

[SOLVED] Re: How to extract run-wise beta value for each condition

Mpark August 26, 2021 02:09AM

Re: [SOLVED] Re: How to extract run-wise beta value for each condition

RWCox August 26, 2021 11:08AM