Confusion about degrees of freedom in F-test, please help!

Dear Experts

I am using an SPM-related toolbox to do functional connectivity analyses.
I have a question regarding the degree of freedom for seed-level F-test on the second-level result and since I have not received response yet from its help forum, I try to turn to a broader audience to see if someone can lift me out of my confusion.

The seed-level F-test basically look at all the connections to other ROIs from one seed ROI to see whether there is a difference in connectivity strength between the two groups among these connections. If the F-test is significant, T-test could then be further used to examine statistical significance of the particular edges. However, I am confused with the DOF of this F-test. I found out that the DOF for the F test is computed with ceil(subjectsNumber/5) and subjectsN-(number of elements in the contrast vector)-ceil(subjectsN/5)+1.

For example, if I have 31 subjects and included 3 variables for the subjects effects-- all subjects, age, and main variable of interest, which is a continuous variable. The between-subject contrast was specified as [0 0 1]. One seed ROI with 20 other target ROIs were designated. And then the DOF for the F-test was shown as F(7,22). (31/5=6.2, ceil(6.2)=7; 31-3-7+1=22).

I don’t understand the rationale of using ceil(subjectsN/5) in the first place. Especially as why this would make the F-test an omnibus test for all the possible connection for a given seed. To me, it does not seem to take into account the total number of possible connections in this equation. So I think I must have missed something.

It would be great if some one could help me out with this problem.
Thank you very much!