Aware of this, I have created a script which will disenthrall you from the pit of ignorance and give you the power to create ROIs just about anywhere you please. The script uses AFNI's 3dUndump, which creates a spherical ROI of a given radius from which parameter values can be extracted using a tool like 3dmaskdump. The rationale is similar to creating ROIs using fslmaths or SPM's marsbar; and if you understand those, using 3dUndump is essentially the same thing.
The only caveat is that you must know the orientation of your dataset before using 3dUndump. AFNI defaults to RAI orientation, in which numbers increase from right to left, anterior to posterior, and inferior to superior; in other words, coordinates to the right of the origin will be negative (since numbers decrease going from left to right), and coordinates anterior to the origin will be negative (since numbers again decrease going from posterior to anterior). Always make sure to check the orientation using a command like 3dinfo -orient before creating your ROI, or open up your anatomical dataset in the AFNI viewer and navigate to the location that you want (e.g., right nucleus accumbens) and then write down the coordinates displayed in the upper left corner of the viewer. You can also use the option -orient LPI, if you're using coordinates from a paper.
This Python script that will let you input the coordinates, and then output a dataset ROI that can be overlaid on your anatomical image. The script can be found here.
Hi Andy,
ReplyDeleteNice helper, and tutorial. The script as posted from the link above needs a slash to make an absolute path in the hash bang, like:
#!/usr/bin/env python (instead of)
#!usr/bin/env python
Otherwise, very useful. Thanks!
Hi Erik,
DeleteThanks for pointing that out! It has been fixed.
-Andy
Thanks! While, what's the anat_MNI+tlrc ?? There is an "FATAL ERROR:-master:con't open dataset" , when I do like yours.
ReplyDeleteHi there,
DeleteThat refers to an anatomical dataset that has been warped to MNI space; make sure that you have normalized your anatomical dataset, and that the name matches, before running the command.
Best,
-Andy
Thanks !
DeleteSo this sphere ROI is individual and in MNI space.
With my understanding, for one group subjects, only one or one series of ROIs should be defined in MNI T1. Then after all native anatomical data have been warped to MNI space, the pre-defined ROI can extract the time cources.
Best
-Bain
That sounds right to me.
Delete-Andy
This comment has been removed by the author.
ReplyDeleteHello,
ReplyDeleteThank you for this tutorial.
I want to create multiple ROIs from coordinates. I used the 3dUndump command and it created multiple spheres but they are all labeled as the same ROI. I know you suggest combining datasets with 3dcalc, but I'll have over 30 ROIs. Do you know of a more efficient way to do this?
Hi Dustin,
DeleteI've been having the same challenge, have you found any efficient solutions to deal with this problem?
best,
Levi