I have two groups (young and older). Yes, this is how I interpreted this, a potential difference in the variance of the two groups.

Thanks!

Pascale]]>

Thank you!]]>

Would you like a new package tonight?

Thanks for bringing it up!

- rick]]>

I'm having an issue with gen_ss_review_scripts.py

Long story short, I've ended up breaking the preprocessing and GLM into separate steps/scripts, and am passing the arguments to gen_ss_review_scripts.py myself because it doesn't know where to find them. That's fine, but it's giving me trouble when I try to specify the final anatomical file. I've verified that the files are all in the current directory and that everything's spelled right.

Here is the command I'm using (ERwD004 is the subject number for this subject):

$ gen_ss_review_scripts.py -mot_limit 0.3 -exit0 -xmat_regress X.xmat.1D -final_anat anat_final.ERwD004+tlrc.HEAD

And below is the error I'm getting (it throws more errors because it's missing other parameters in the above command, but I've solved those without any issues)

Traceback (most recent call last):

File "/data/nil-external/mcl/tools/afni/gen_ss_review_scripts.py", line 2679, in <module>

sys.exit(main())

File "/data/nil-external/mcl/tools/afni/gen_ss_review_scripts.py", line 2672, in main

if me.write_scripts():

File "/data/nil-external/mcl/tools/afni/gen_ss_review_scripts.py", line 2020, in write_scripts

if self.make_drive_script(): return 1

File "/data/nil-external/mcl/tools/afni/gen_ss_review_scripts.py", line 2226, in make_drive_script

if self.drive_align_check(): return 1

File "/data/nil-external/mcl/tools/afni/gen_ss_review_scripts.py", line 2490, in drive_align_check

apre = self.dsets.final_anat.prefix

AttributeError: 'VarsObject' object has no attribute 'final_anat'

Any thoughts?

Thanks!

[afni -ver: Precompiled binary linux_openmp_64: Jan 3 2017 (Version AFNI_17.0.00)]]]>

Do you have two or more groups? Heteroskedasticity in the sense that those groups may have different variances?]]>

I conducted a group-level mixed effect ANOVA using 3dMVM in a recent paper and was asked by a reviewer if 3dMVM can account for heteroskedasticity ? I could not find an answer in the documentation.

Thanks for any info !

Pascale]]>

rm.mask_r01+orig.HEAD

rm.mask_r01+orig.BRIK.gz

full_mask.S142290+orig.HEAD

full_mask.S142290+orig.BRIK.gz

first of all I would like to know the difference between these files.

And my second question is that how can I compute the union of several masks and combine them into a single mask. (I know that I should probably use 3dmask_tool but I don't know how)

Here is what I have done so far Based on this tutorial,. I checked

3dAutomask -dilate 1 -prefix rm.mask_r$run pb03.$subj.r$run.blur+orig

Now I don't know how to do these steps:

3dMean -datum short -prefix rm.mean rm.mask*.HEAD

3dcalc -a rm.mean+orig -expr 'ispositive(a-0)' -prefix full_mask.$subj

When I run the first command I get:

Thank you very much for your time.]]>

But I'm still unclear.

from the help doc:

ac ac+tlrc'[14]' ac+tlrc'[15]' \

ejk ejk+tlrc'[14]' ejk+tlrc'[15]' \

ss ss+tlrc'[14]' ss+tlrc'[15]' \

How does that differ from this?

1 1_coef+tlrc 1_tstat+tlrc \

2 2_coef+tlrc 2_tstat+tlrc \

4 4_coef+tlrc 4_tstat+tlrc \

Each includes 3 columns, with 1) subj id, 2) coefficent, and 3) t value.

No?]]>

> to put Cond as the random effect (adjust it by subjects).

Ideally you want to model both the cross-subject variability in terms of RT effect and the cross-subject variability among those conditions (and their variance-covariance structure). However, 3dLME currently does not have the functionality to specify cross random effects (possible in the future), so you'd have to choose one at the moment.

> I actually have Cond1 (2 levels) and Cond2 (2 levels). So the fact that I have four RTs per subject -

> one per Cond1*Cond2 combination - is unclear to me... Can RT be both a within- and a between-

> predictor? If so then this is new to me, I can't think how this is implemented mathematically. After

> centering, we expect no within-subject effect of RT anyway.

No, centering would not change anything about the RT effect itself. Instead it artificially shift the center value among the subjects, and in the end it won't have any impact on the RT effect estimate. What it changes is the following: 1) maintaining the integrity of the interpretation for other effects such as condition effect in your case, 2) avoiding potential correlation (collinearity) between RT and conditions.

> So why don't we just give one number which is the average for each subject (across Con1 and

> Cond2), thus it is just a between-subject covariate?

Such a combining step would involve information loss and render inferior modeling.]]>

The part you saw on the terminal is *not* really the full output information, but something about the FDR calculations for those statistical sub-bricks. To see all the sub-bricks, try

3dinfo -verb your_output_file]]>

1 1_coef+tlrc 1_tstat+tlrc \

2 2_coef+tlrc 2_tstat+tlrc \

4 4_coef+tlrc 4_tstat+tlrc \]]>

Is there anything obviously wrong with this 3dMEMA command?

3dMEMA -jobs 1 \

-prefix test_mema_out \

-set TEST \

1 1_coef+tlrc 1_tstat+tlrc \

2 2_coef+tlrc 2_tstat+tlrc \

4 4_coef+tlrc 4_tstat+tlrc \

-missing_data 0 -residual_Z

(It's a test case I created to debug. I don't actually have only 3 subjects for my analysis.)

That command continues to generate this message:

Warning in MEMA.parse.set(lop, ops[[i]]) :

Length of op must be 3*N+1

Make sure what follows -set is of the form:

-set SETNAME <subj BetaDset TstatDset> <subj BetaDset TstatDset>, ...

What I have is: TEST 1 1_coef+tlrc 1_tstat+tlrc 2 2_coef+tlrc 2_tstat+tlrc 4 4_coef+tlrc 4_tstat+tlrc -missing_data 0

Warning in read.MEMA.opts.batch(args, verb = 0) :

You must have either one or two groups

Error: Error parsing input

Execution halted

I'm not seeing how "What I have" does not agree with "Make sure what follows -set is of the form"

Thanks]]>

Though I would expect there to be a warning,

particularly in the case of NL warp.

- rick]]>

As you said, I definitely want to control for the variability of RT, and clean out its contribution from the overall variability. Because of collinearity, as you said, I should center within each condition, no matter how I do it. I just wonder about two things (and perhaps I just didn't fully understand your previous answers, so my apologies if so):

1. If the point is removing irrelevant variability from the data and I'm not interested in RT per se, why should I put it as a random effect and not a fixed effect in the first place? It seems more relevant to put Cond as the random effect (adjust it by subjects).

2. I actually have Cond1 (2 levels) and Cond2 (2 levels). So the fact that I have four RTs per subject - one per Cond1*Cond2 combination - is unclear to me... Can RT be both a within- and a between- predictor? If so then this is new to me, I can't think how this is implemented mathematically. After centering, we expect no within-subject effect of RT anyway. So why don't we just give one number which is the average for each subject (across Con1 and Cond2), thus it is just a between-subject covariate?

Thanks,

Galit]]>

There should be a tiny difference in EPI to

anat alignment of course, but I would expect

the registration of the anat to the template to

be identical, meaning the ROIs should still

be in alignment.

Did you actually compare these in the afni

GUI? Did you compare the final_anat+tlrc

dataset between the two methods, and how

the ROI overlays them?

- rick]]>

It turns out the error messages derived from both -wsE2 option and wrong path for R package.

Thank you so much.

I have one question regarding output.

I expected I could get the same number of t-stats image as the no. of gltLabel (in my case, 12).

However, just one output file was produced after performing 3dMVM script.

Here is the output which was printed in terminal.

++ Smallest FDR q [0 (Intercept) F] = 6.99541e-07

++ Smallest FDR q [1 c01 F] = 7.63635e-08

++ Smallest FDR q [2 c02 F] = 4.77009e-13

++ Smallest FDR q [3 c01:c02 F] = 3.48735e-05

++ Smallest FDR q [5 .... t] = 6.70835e-07

++ Smallest FDR q [7 ... t] = 3.05506e-08

++ Smallest FDR q [9 ... t] = 0.00627071

++ Smallest FDR q [11 _vs_ t] = 1.56036e-08

++ Smallest FDR q [13 _vs_ t] = 1.54795e-06

++ Smallest FDR q [15 _vs_ t] = 8.3346e-06

++ Smallest FDR q [17 _vs_ t] = 0.00029295

++ Smallest FDR q [19 _vs_ t] = 1.13479e-06

++ Smallest FDR q [21 2way_interaction t] = 0.00208255

*+ WARNING: Smallest FDR q [23 2way_interaction t] = 0.832452 ==> few true single voxel detections

++ Smallest FDR q [25 2way_interaction t] = 0.00813095

++ Smallest FDR q [27 2way_interaction t] = 0.00293417

*+ WARNING: varying brick factors, writing NIfTI as float

In summary.Anova.mlm(object$Anova, multivariate = FALSE) :

HF eps > 1 treated as 1

Thank you for your great help.

Jeong]]>

Thank you!

Jogi]]>

- The original_ttest_result+tlrc, thresholded at FDR corrected p<0.05
- The output of 3dFDR -input original_ttest_result+tlrc -prefix adjusted_ttest_result, which provides a Z-map based on FDR corrected p-values, thresholded at p<0.05.
- The output of 3dmerge -1thresh '0.05 *q' original_ttest_result+tlrc.
- The output of 3dmerge -1thresh 1.96 adjusted_ttest_result+tlrc, which corresponds to a corrected p<0.05.

Views (1) and (2) are the same, and (3) and (4) are the same, but those two sets differ. Stranger still, one is not a subset of the other. I've provided a couple images, for what they are worth. The first corresponds to display (1) and the second to display (3).

Thank you---I'm sure I'm overlooking something obvious.

[attachment 220 display_1.jpg]

[attachment 221 display_3.jpg]]]>

I would not expect FD to be based on alignment between

successive pairs of volumes, but to be on the same

alignment to a single base volume.

You can verify these things, but...

From what I recall, FD is the sum of of the absolute

differences between the motion parameters at successive

time points (we do not compute this, because it seems

very strange to use this over the Euclidean distance).

But it should be easy to compute this using the motion

parameter files output by 3dvolreg (via either -dfile

or -1Dfile).

Between 2 time points, just add up the absolute values

of the differences between the six terms. There may

be a preferred scalar to apply to the rotation terms,

so maybe you can look that up.

- rick]]>

Were the ROIs drawn on the original space anatomy or the

standard space one?

Keep in mind that regardless of the processing done to the

EPI, the ROIs are aligned to a particular anat. So all you

have to worry about is what happens to the anat.

- rick]]>

No, those options are to possibly help registration

when it might be difficult. You might want to

evaluate this more directly using align_epi_anat.py,

before putting the resulting parameters into the

afni_proc.py command.

- rick]]>

The maximum pairwise displacement from 1d_tool.py is

computed as follows. Let the distance between any two

time points be the Euclidean distance of the motion

parameters in 6 dimensions (sqrt(sum squares of 6 diffs)).

The help shows how to understand this in 1 dimension

just as a simple example (where Euclidean dist is the

same as abs(diff)). But that does not extend to the

6 dimensional space.

See also "gen_ss_review_scripts.py -help_fields".

- rick]]>

> 1. A lot of studies have demonstrated that the pre-processing steps used by the authors still might not fully take

> care of motion artifacts and we know that there are strong group-level differences in motion parameters.

One possibility is to control the motion effect at the group level by using those motion parameters as an explanatory variable (i.e., covariate).

> 2. My main comments to the paper are that the authors do not show how the results could be affected

> by artifacts and noise in the data that clearly affect global connectivity results.

To address that concern, you may perform another analysis without controlling for the effects of those artifacts and noise, and see how they differ.]]>

Yes, that's right: you should center the variable within each level yourself before feeding into the data table.

> what is the gain in adding RT as a random effect? You wrote that it accounts for "RT

> variability across subjects *within* each level" - I think I don't understand the "within

> each level" thing... How does the fact that RT is subdivided by Cond enters into the

> analysis? Doesn't (RT|Subject) mean that the *average* RT is adjusted per subject?

There are two reasons for incorporating a variable (e.g., RT in your case) in a model: 1) you're interested in the effect of the variable, and 2) you would like to account for the variability in the data due to this variable.

For the second reason above, another way to say it is that you want to control the variable at a specific value, which is what centering is about. How you center the variable may have a huge impact on the results as well as the interpretation of the results. For example, if you center the variable at the overall mean in your case, you may face the following problem, which is basically associated with the fact that the two conditions are correlated with the RT values: does it make sense to compare the two conditions if RT is fixed at the overall mean while you already know that the two conditions have different average RT?]]>

Try the following:

1) make sure you have the most recent version of AFNI:

@update.afni.binaries -d

2) have all the required R packages installed:

rPkgsInstall -pkgs ALL

3) remove option "-wsE2 " from your 3dMVM script

4) run the following command if you still have trouble running the script:

afni_system_check.py -check_all]]>

I am trying to calculate the frame displacement (FD) according to the formula given in Power et al. 2012. The goal is to compare FD values between two groups. However, I have some doubts regarding how I can implement this with the output I have access to (the data is already analyzed). If I understand correctly, frame displacement represents the absolute value of displacement changes in the x, y, z directions as well as rotational changes (roll, pitch and yaw--once converted to mm) between adjacent volumes.

I only have access to the motion files (2 runs) and the .1D matrix from 3dVolreg. The base for registration was the 10th volume of the 2nd run. With the output that I have, can I calculate an FD value per participant? If I understand correctly, the motion parameters in the motion file represent the displacement between the volume and the base volume used for registration, which are not adjacent.

Thank you in advance for your help,

Sincerely,

Isabelle]]>

I take the inverse (zeros become 1s; 1s become 0) of M v. baseline thresholded at p = 0.01, (or p = 0.005), and exclude those voxels in 3dLME or 3dANOVA by specifying this inverse mask with the line "-mask inverseM+orig."]]>

After updating AFNI, I did 3dMVM with script like below (table.txt included paths for MNI spaced cope files)

3dMVM -prefix Emo_MVM -jobs 8 -bsVars 1 -wsVars "var01*var02" -wsE2 -num_glt 12 \

-mask MNI152_T1_2mm_brain_mask.nii.gz \

-gltLabel 1 c01_vs_c02 -gltCode 1 'var01 : 1*c01 var02 : 1*c02 -1*c03' \

....

-gltLabel 12 .... \

-dataTable @table.txt

Unfortunately, I faced on error messages.

1) Error messages encountered like below:

Welcome to afex. Important changes in the current version:

- Functions for ANOVAs have been renamed to: aov_car(), aov_ez(), and aov_4().

- ANOVA functions return an object of class 'afex_aov' as default, see: ?aov_car

- 'afex_aov' objects can be passed to lsmeans for contrasts and follow-up tests.

- Reset previous (faster) behavior via: afex_options(return_aov='nice')

- Many more arguments can now be set globally via options, see: afex_options()

************

load package: car

Loading required package: snow

Error in checkForRemoteErrors(val) :

2 nodes produced errors; first error: length is 0

Calls: aperm ... clusterApply -> staticClusterApply -> checkForRemoteErrors

warning messages:

In summary.Anova.mlm(object$Anova, multivariate = FALSE) :

HF eps > 1 treated as 1

2) after change from -jobs 8 to -jobs 1, the error message encountered like below:

load package: car

Error in if (p_wsmvt < uvfm$anova[ii, "Pr(>F)"]) out[ii] <- qf(p_wsmvt, :

length is 0

Calls: aperm -> apply -> FUN

warning messages:

In summary.Anova.mlm(object$Anova, multivariate = FALSE) :

HF eps > 1 treated as 1

It will be great pleasure if know the solution for error messages.

Thank you,

Jeong]]>

Now a few days after that, the data is analyzed using a new pipeline:

Thank you!

Jogi]]>