afni_proc.py blurring

Hello,

I am performing a seed-based analysis on resting-state monkey data. When I first processed this data, I used the default afni_proc example 9b with blurring at 4.0mm. While discussing this data with collaborators, I was told not to blur individual subject data but to apply 3dmerge -fwhm after the deconvolution. I repeated the afni_proc processing without the blur option and used fast anaticor for the sake of time.

The problem is, these different pre-processing steps result in different contrast maps. They are actually opposite - one results in correlated activity and the other, anti-correlated. I am not sure what to make of these conflicting results and which is the correct, or best, way to process this data. Please help - the abstract for SfN was written with the first dataset :0/

** I just noticed I ran 3dmerge before converting to a z-score so I think that might have flipped the sign. Double checking now… Any wisdom still appreciated! Thanks!

Hi Sharyn,

That is certainly strange. For what it is worth, I would
expect very little difference between blurring before and
after projection of unwanted signals.

Oh, it seems you are blurring the correlation values,
rather than the time series data. That is not quite a
linear operation anymore, and will be a little different.
But it should not lead to an opposite contrast map.

Did you run the normal ANATICOR in the first case and fast
in the second? Can you compare the white matter masks that
were used for these steps? Note that with monkeys, I would
be unsure about how well one could make the white matter
masks. If they bleed into important gray matter, then doing
a local regression might damage the results.

If you would like to, please send me email with the two
afni_proc.py commands, possibly attaching corresponding
proc scripts.

Exactly what commands are you running, both to get the
correlations and to get from there to the contrast maps?

  • rick

Hi Rick -

So, the issue with the reversed contrast map was my error because I was running 3dmerge to blur the datasets before using 3dcalc to generate a z-score. If I take the output from 3dmerge and put it into 3dttest++ with -toz option, the contrast maps are comparable.

#blur at 3mm
3dmerge -doall -1blur_fwhm 3.0 -prefix {s}_{ROI}_blur3.nii.gz {s}_{ROI}.nii.gz

#Fisher’s z-transform

3dcalc -a {s}_{ROI}_blur3.nii.gz -expr “0.5*log((1+a)/(1-a))” -datum float -prefix {s}_{ROI}_ztrans.nii.gz

That said, the processing blocks in afni_proc.py were not identical - namely, the anaticor vs. fast anaticor, but also the fast anaticor dataset was not scaled. I know in example 9b the scale processing block is not included. Could you speak to whether it’s a good idea to scale resting state data? Also, I cannot find in the afni_proc help how the corr_brain file is generated. I am assuming this is whole brain correlation but is it kind of like an ICA, then?

Thanks for your help, Rick!

I am including images of the white matter masks generated from anaticor versus fast anaticor for your reference in monkey. They are pretty much identical.

anaticor_WM_mask.jpg

Hi Sharyn,

I still don’t see how changing when the blur is applied
would change the signs too much. It should change the
weights a bit whether it is applied before or after
converting from r to a z-score, but even that conversion
is almost linear when the r-values are in [-0.5, 0.5],
which should be the case for most voxels. This makes me
suspect there might be a mistake in the processing.

Those anaticor masks look identical, but they also look
a bit too big. Exactly how were they created? It is
damaging to the results for them to include gray matter.
And that damage might be worse in the case of the fast
anaticor method.

Try eroding those WM masks and running it again, if you
can.

  • rick

Did you want to look at the afni_proc command or the output (to see how it was created)?

So I should re-run afni_proc like example 10? With eroded WMe instead of anaticor?

Also - just to be sure - the .jpgs I uploaded were the mask_WM_resam generated by afni_proc.py. Did you want those or the mask_WMe_resam?

Thanks,

S-

Hi Sharyn,

It is good to hear that the masks you showed were not eroded,
but presumably the afni_proc.py script does apply the eroded ones.

But this difference is still concerning. If you send me direct email
with your two proc scripts, I would be happy to suggest commands
to reproduce the errts but without ANATICOR. I think it would be
good to verify whether that is making the difference in signs. If it
is, then it suggests your masks might be bleeding into gray matter.

Please feel free to send those scripts via email, or contact me via
the PM link (private message) next to my name.

  • rick

Hi Rick - I sent an email to your NIH email. I didn’t see a place for attachments on the PM…

Thanks!