ANTsX / ANTsR

R interface to the ANTs biomedical image processing library
https://antsx.github.io/ANTsR
Apache License 2.0
127 stars 35 forks source link

Ability to identify neighbors of any given voxel #321

Closed ptsii closed 4 years ago

ptsii commented 4 years ago

Is there a tool(s) in ANTsR (or ANTs) that would allow me to do something like the following:

For each voxel, identify all neighboring voxels that are less than some (user-defined) distance away from that voxel. I think this could just be a simple binary mask (1's = voxels of this 'neighborhood'). The goal would be to be able to take data from two different fMRI studies of the same subject, and see whether there are areas for which the pattern of BOLD response across voxels in that 'neighborhood' for the two fMRI tasks is correlated. So my thought was to take each voxel one at a time, find its 'neighborhood', calculate the correlation between the BOLD responses (these are actually t-value maps) for the two tasks on those voxels, assign that correlation value to the voxel that defined that local region (in a separate copy of the image space for that subject), and repeat over the whole brain. This would allow us to see if there are some areas where the two tasks show greater or lesser degrees of correlation for the two tasks.

Does this make sense?

Background: I have data from two different fMRI tasks on the same individuals, and I want to assess the extent to which the BOLD signal for the two tasks are correlated within subjects (and then further assess whether there is a consistent group level effect). The tasks are very different, but for each one we have calculated contrasts between conditions, and have t-maps for each subject. Given that the tasks might vary in strength of the BOLD signal, we would like to try to assess correlations (rather than just overlap of areas for the two tasks that happen to exceed some threshold), to try to determine whether there is some non-trivial similarity in BOLD response in the two tasks. We expect beforehand that some areas will not be used by both the tasks, but other areas would. The question is: How best to identify if there are any areas that are coactivating.

Thanks for any thoughts or suggestions!

stnava commented 4 years ago
 ?getNeighborhood*
ptsii commented 4 years ago

Beautiful!

ptsii commented 4 years ago

OK, so I can see how to use this to make calculations based on the neighborhood voxels of each individual voxel in a mask using getNeighborhoodInMask - this is outstanding. I assume I can use matrixToImages(dataMatrix, mask) to write the resulting voxel values back into the same image space (if I use the same mask)?

stnava commented 4 years ago

That would work but it would be easier just to extract the Result Of your calculation which would be a vector and then use makeimage

On Sat, Jun 20, 2020 at 4:48 PM ptsii notifications@github.com wrote:

OK, so I can see how to use this to make calculations based on the neighborhood voxels of each individual voxel in a mask using getNeighborhoodInMask - this is outstanding. I assume I can use matrixToImages(dataMatrix, mask) to write the resulting voxel values back into the same image space (if I use the same mask)?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTsR/issues/321#issuecomment-647043863, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACPE7UBB3A5DP7ERRWRQP3RXUOCVANCNFSM4ODB7PJQ .

--

brian