I’m trying to learn to preprocess fMRI data with AFNI.

I’m at ‘outcount’ stage, and have a question about deciding the order of Legendre polynomial for the option, -polort in 3dToutcount function.

I’ve heard that the order of polynomial varies according to the total length of time series of fMRI data and that it can be calculated through an equation.

But I can’t find the equation in internet and I wonder how I can give the order to AFNI.

Could you let me know how to decide the most appropriate order of Legendre polynomial when I use 3dToutcount? Is there an equation which helps to get the polynomial order?

I highly suggest starting with afni_proc.py to generate
a processing script, and then understand the details of
that. For example, I would suggest using the same
polort that is used in the regression for outliers, which
you would see in a generated proc script.

But I’ve finished the tutorial(FT_analysis) and tried to work on the real data.

And the length of time series of the tutorial data and the data I’ve got from the subjects are different, so I think I should apply different polynomial order for 3dToutcount to the real dataset compared to the tutorial dataset, since the characteristics of the dataset are different.

That’s why I ask how I can get the appropriate polynomial order for 3dToutcount. One of my seniors told me there would be an equation which helps me to calculate the polynomial order, but I couldn’t find one.

Great, going through that by hand is really important.

Once you have a good understanding of the steps, or even
before then, I still suggest using afni_proc.py to write
an analysis script. That gives you something to compare
against, both in terms of ideas for writing a processing
script and in terms of the actual resulting statistics.

The formula that we use for polort, which is applied by
afni_proc.py and by “3dDeconvolve -polort A”, is
pnum = 1 + floor(run_duration/150), where times are in
seconds.

For help, see the description of option -polort in
“3dDeconvolve -help”, as well as -regress_polort or
even -outlier_polort in “afni_proc.py -help”.

Yes, pnum would be the order of polynomial used in 3dToutcount
or 3dDeconvolve, while run_duration is the duration of the run
in seconds (regardless of the number of time points).

Yes, polort=6 is right for a run length of 840 s. That is a
long run.

The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.