25 - Surface Analysis: SUMA: Part 2 of 5
February 12, 2019
May 31, 2018
Daniel Glen, NIMH
All Captioned Videos AFNI Training Bootcamp
Gang Chen, NIMH
For more information and course materials, please visit the workshop website:
We recommend viewing the videos at 1920 x 1080 (Full HD) resolution for the best experience. A lot of code and type is displayed that may be hard to read otherwise.
PRESENTER: So over here, it shows you these blue and green lines have been drawn inside SUMA. And if you look at it across different surface modes, you can see how they look. And they can travel in and out of a sulcus or across a gyrus, and in inflated mode, they can look just like a straight line. Different views give you different renderings of the same regions.
Now, inside AFNI, you can control what the surfaces look like. Here we have these lines here. So we have control surface. And that brings up a menu here, where you can say I want to see the one surface in green and dark blue. And you can change the colors of the other surfaces. You can see the nodes, if you want. And so here we see the nodes. Every block here is a node. So if you want to see exactly where the nodes are, that's how you would do that.
OK. You just turn that off for the defaults here. And then you can change the line width that you want to see in the thicker line. You see all the surfaces in a thicker line.
OK. So that's there under Control Surface in the AFNI GUI. So if AFNI is talking to SUMA, you'll see that Control Surface menu.
All right, so now let's go through and see, here we have a-- all this family of surfaces that you see are all defined in the spec file. The spec file has this pretty simple format that says what's the name of the group of surfaces and what surfaces, what surface states there are.
And so we're going to have the smooth white matter, peel, inflated, and then we can have the definitions of each of the surfaces below that. And some of them have three dimensions in it. Some of them have a domain parent. So this one comes from the smooth white matter surface. So the spherical surface gets its dimensions, its x, y, z coordinates from the smooth white matter. So when you click on a sphere inside SUMA, it still knows how to talk to AFNI by going through the smooth white matter's x, y, z location.
Mostly, you don't have to know what the spec file does. And mostly, you won't have to create one yourself, because it's created for you by addsumomakespec.fs if you're using FreeSurfer. If you're not using FreeSurfer, you may need to edit one. Or you can use the program called QuickSpec to make a spec file quickly, OK? This is mostly details on how to create the spec file.
Yeah, so we've seen the comma and the period to go among the viewing states. Let's go back to SUMA here. And I'm going to put it back into then filled mode. And then do Control-N, and then you'll have another surface pop up. And like AFNI, we have the A and the B controllers. Here we can have six controllers. Now here, we have them both going together. They're locked together.
Now, it's not very interesting to see two of exactly the same thing. So let's change the second one to a different kind of surface. So this is the peel surface. And then if we move them, they're also locked together.
And as you click, they're still connected to AFNI. So all of these-- and AFNI can have multiple controllers. AFNI could have 10 controllers open. SUMA could have six controllers open. They'll all be locked together, and you'll see the location across all your data sets in the same place.
The SUMA controller that controls the linking is available through Control-U. If you do Control-U, you can see it's got all these viewers are all locked together here. Anyway, most of time, you are going to lock them together. So it's really not worth saying how to unlock them, but you can do it here. And this, of course, takes up a lot of screen real estate. So you're not going to do too many of these.
The next topic is an important one for if you're doing group analysis. Now, in the volume, what we've been doing is we take everything into a standard space by aligning the volumes to a template, and then they're all, every voxel has a correspondence by its voxel location, its x, y, z location. We don't do that in surfaces. We do something else. We're going to make the nodes, every node correspond across subjects. And this is how we do it.
If you have an original anatomical surface and it's inflated, and you have a spherical surface, that's the inflated version of that. Here, you could warp that spherical surface to match some template like this. And it's got a series of gyri and that kind of thing. It's got its own shading for where everything is. All the anatomy is represented onto a surface of some template.
So the sphere is warped to the surface, And then we take this warped surface and we do the trick of putting it onto an icosahedron that has a lot of nodes on it, OK? And for every node on the surface, we calculate where it is on the warped surface, which corresponds to a location on the spherical surface, which corresponds to a value in the original anatomy. And so we're going-- this actually, so the icosahedron is going to have some x, y, z location that's going to be between the nodes of your warped surface and between the nodes of the spherical surface and the anatomy surface.
So we're going to go all the way back, and we're going to calculate new nodes that are going to be very close to the original nodes. And there will be some interpolated value of the original nodes. And this will be a surface that will have an x, y, z location for each of the nodes very near the original and in order. It's very important that it's in the original order of the icosahedron here. So this icosahedron is defining our node order, going from node 0 to node 200,000.
OK, so we have all these nodes, and now we have a nodal correspondence across all of our data. All of our subjects will have the same node numbering because of this process. Now, and I have to say that most of the work here is done by this warping to match the template. Because we are provided this by FreeSurfer, we've got almost everything that we need right there. And so all we have to do is this fairly simple interpolation of our node numbers and what nodes are nearby on the sphere.
So this process is pretty straightforward, then. And then we have this nodal correspondence. So if we're going to do an analysis, we can just compare across nodes and not across voxels that are in any particular x, y, z location. Just at this node number, how much is it similar or different across subjects?
OK, and if you look at the difference between the anatomy and the standardized anatomy, they look almost identical. We really haven't changed the surface, other than putting in-- generally, we put in more nodes than what it started with. If we put in fewer, then you might see the difference. So FreeSurfer comes out with a certain number of nodes. We generally recommend a very high number of nodes, with roughly about 200,000 nodes in the surface for each hemisphere.
And this is what it looks like for six different subjects. These are all on a standard mesh. So when we're comparing subjects, we compare-- basically, the color here indicates at the node index. And so we're comparing node for node across these different subjects. And this is what group analysis relies on, that correspondence.
So this part of the brain matches that part of the brain. Does it match exactly? It's not exact, but it's pretty close, and this is what is enabled through-- what enables surface analysis. And as I said before, then you can use all the AFNI tools that don't do anything spatially. They will do things across these nodes.
And this is what the original meshes looked like. While they have some kind of general order to them, they're not exactly in the order that we want. And sometimes, they have nodes that are out of order. You can see over here, FreeSurfer will add in nodes at the end. So they're in-- they're not nodally corresponding. So that's part of what gets fixed by this procedure that we do.
So all that's done by atsumamakespec.fs, which calls map icosahedron, which generates all these surfaces and also transfers over things like thickness and convexity and sulcal depth.
We have a lot of different programs for looking at surfaces to compare surfaces from one to another. One way to calculate thickness is to look at the distance from peel to white matter, because they're corresponding. Every node corresponds across those two surfaces. You can use that as a measure of thickness. I'll talk about some more ways to compute thickness, cortical thickness and other thickness tomorrow. You can get various metrics of your surfaces with surface metrics. Really there are a lot of different surface programs.
Looking at these problems in the surfaces, if you zoom into these locations, you'll see this kind of twistiness of the meshes. This happens less and less often, especially with the newer versions of FreeSurfer, but it still can happen. It's OK if there's some problems like this. Mostly, AFNI and SUMA will deal with it OK. But if it gets to be too much, then insides and outsides get flipped around, and you probably need to regenerate your surface or smooth the surface as it goes.
The other part that you need to consider is, and this brings up a kind of an important topic, is that when FreeSurfer gives you your data, it's in something like your original space. It usually is exactly the original space if you use an even number of voxels on your data in all dimensions. This is a little known fact.
So if you use an even number of voxels in every dimension, x, y, and z, and then you do FreeSurfer, your data will be pretty much in the same spot. If one of the dimensions, or more or all three, are off, they're odd-numbered, you will get something just slightly off from your original.
You could fix it with atsumaaligntoexperiment or you can-- I would recommend just zero padding your original data so that you don't have to worry about this. So zero padded, so it's even numbers on all sides. That is something that is not very well known and probably should be.
So AFNI Proc Help now includes a note about FreeSurfer for this. Good, yeah. But almost everyone I've talked to about this has very little idea that this actually happens. And it produces a very subtle effect.
Not subtle effect is if you've got data from another session that your anatomy is in a different place, but you still want to use the surface that it took a day to generate. You can do it with the atsumaaligntoexperiment. You'll get a new surface volume, and that surface volume contains within it a header, an affine transformation that says how to move any other surface-- to move a surface to that day's experiment, that session's experiment.
So a lot of SUMA programs, surface programs, will take a dash SV option, and that SV option asks for this surface volume, the surface volume that's aligned to experiment. If it's talking to AFNI, SUMA is called with a dash SV option, it will say all the surfaces have to be moved in this way so that it matches the volume.
3D tag align-- I don't know that anyone would do that for this, but you can do alignment of your data that way too. Yeah, so just an example of how to run atsumaaligntoexperiment. You give it your anatomy. You give it what FreeSurfer has given you back, or what atsumamakespec.fs has given you as your surface volume, and it will generate a new surface volume for you, a new experimental volume.
OK, so here's the output. Here's called SUMA with dash spec. You give it the same kind of thing that we are using here, and the surface volume that's aligned to the experiment. And so it transforms all the surfaces for you.