I want to find the Euclidean distance between a node in one hemisphere and the location of every surface node in both hemispheres.
For example, for node 105 in the left hemisphere, I want to know how far this is from every node in the right hemisphere and left hemisphere of the pial surface. I am using this command:
Nodes.1D is a list of number [0,198812). When $hemisphere is set to “lh” vs. “rh”, I get different output distances, but I am concerned that the function is ignoring the L in “from_node 105L” and just looking at the distances between node 105 to every other node within each hemisphere’s surface. How can I find euclidean distances across the hemisphere?
For SurfDist, I don’t think you can find cross-hemispheric distances. Each hemisphere is a separate mesh. There isn’t a principled way to “hop” between meshes, as far as I know.
While it’s hard to say how one might come up with a geodesic distance, you can compute a euclidean distance pretty simply. It’s just a distance between two xyz coordinates with sqrt((x1-x2)^2+(y1-y2)^2+(z1-z2)^2). You only need to put the coordinates of interest into a file for each surface.
Ah, I see, I misread the question; it isn’t concerned with distance constrained along the surface mesh, just the “as a crow flies”* distance between two points ?
–pt
NB: this is not a recommendation to have birds fly within someone’s cortex.
That’s right. It is a fairly simple problem. Just to make this a little simpler, here is an example of one way to compute the euclidean distance within AFNI. The distance is computed pairwise from two 1D text files each with 3 columns of x,y,z coordinates. You would have to duplicate the rows in one of these files to find distance to a single xyz coordinate.
Thanks for the help! I ended up using “SurfMeasures -func coord_A” to retrieve the coordinates for every node in both hemispheres. Then, I wrote a python script to find all of the Euclidean distances that I needed. I appreciate your responsiveness.
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.