[NOISE] [MUSIC] Okay, so we are now going to do co-registration, the same thing we did with FSL using ANTs. The idea is exactly the same as before. We address the same problem, except that now we will work with ANTs instead of FSL. So let me remind you what is it we try to do. We have a Baseline FLAIR and T2 image, and also we have a Baseline T1 image. So these are three different sequences, and we would like to align them within the same visits. And the image in front of you is a representation of that. In the red box we show exactly what we try to do. We want to take the Baseline FLAIR and Baseline T2 and register them to Baseline T1, so that everything is in the space of Baseline T1. This is exactly the same thing we did with FSLR, and we remember that in FSL, this particular image didn't register all that well. But let's see how to do this in ANTs. The idea is exactly the same, and the R codes is very similar, very transparent so that in case we decide to move from FSL to ANTs or from ANTs to FSL, for everything to be seamless and easy to translate from one to the other. So, this is part of what we did, we tried to bring the R functions to a template, to a format where we can easily go from one to the other. In this particular context, we will use the extrantsr function, and specifically we will look at the ants_regwrite function within the extrantsr package. So, we'll use this to register the T2 to the T1 file first, and then we will do the same thing for FLAIR. So, how do we do that? We define, in this context, we define the T2 file path. As before, the function file.path of MRI directory, which is the same thing as defined in FSLR. And we simply define, we provide the file name, which is 113-01-T2w.nii.gz. So now ants_regwrite knows what is the file path to the T2_file. The function ants_regwrite could also work directly with the loaded file or with the file path. In this context we will just use the file path. The registration of the T2 to the T1 image is now very easy to do. We will store the results in reg_t2_img or in something else if you prefer a different name. And this is simply calling ants_regwrite and it defines the file name which is the file that will be registered to the template file. In this case, it's a T2 file and the template file is a T1 file. The type of transformation is an option, and in this case is rigid, so everything is in one line, or maybe two lines. And there are many options that could be changed. The type of transform, the template, the file that will be transferred to the template, and so on and so forth. But it's good to have everything on one slide. And in this context, this is Skull on registration, the same thing could be done with Skull off, but it will require to first do Skull shipping procedures as we discussed, and then register to a template without a Skull. We just saw how to do registration using T2 to T1. But we have another file, you have the FLAIR. So in this context, the question is how do you register the FLAIR to the T1. Well, there is basically no difference except that we now define the file path for the flair_file just as before and we simply change the name of the file we look at. So in this context it's 113-01-FLAIR.nii.gz, and just to see the difference from the previous file this is 113-01-T2w.nii.gz. So this is the only difference between these two things. And then we use exactly the same function and we register the FLAIR image, which is in the filename, to the template file T1. In this context, now we'll have both the T2 and the FLAIR images registered to the T1 template file. Well, we saw before that FSL didn't work that well, let's see a little bit how ANTs did in this context. So this is the double ortho function that presents side-by-side the T1 on the left and the T2 registered image on the right. This type of images are very nice to look at because they kind of provides the basic quality control images that we will like to look at. Are they in their same space? Do they look reasonable? Are they tilted? And, in this context, it looks like the registration was quite successful. In the FSLR case, the image was tilted, there were some artifacts showing up. This is not to say that FSLR will always fail and ANTs will always succeed, or the other way around. That's not the point of what we are showing here. In fact, it's quite useful to have multiple tools, to check one versus the other and one against themselves. The point here is that after registration, one has to actually look at the images and make sure that things look reasonably in the same template. We actually advocate to have and to use both ANTsR and FSL and then check things against each other. Another view of the same image is instead of having them side by side we can over-plot them and this is what the ortho2 function does. It uses the T1 as the template and it overlays the register T2 image using a little bit of alpha blending as you see in the function. So this is another way of looking into, checking, doing a little bit of quality control, making sure that things are not totally off, that the region transformation worked reasonably well. The same exact thing can be done for the FLAIR image. So, we saw how to do the side by side and the overlay images for the T2, versus T1. We can do the same thing with the FLAIR images. Again, we are looking for obvious changes, shifts, artifacts, things that just don't belong there. In this context again, the FLAIR image seems to be quite well registered to the T1 image. We can also look at the overlay images just like we did before, so the only difference between this overlay and the previous overlay is that now we are overlaying the FLAIR image to the T1 image. And again things are not perfect but they look quite good. The functions are the same, and once we start to do analysis on a larger scale, it is very useful to have these functions and either use them in a for loop or, and then save the images and have a look at them for kind of a visual quality control approach to neuroimaging. Okay, so what are some of the results? Overall, there seems to be good overlap after registration with ANTsR. We were a little surprised that on this image, flirt didn't perform that well, which is a lesson for us and for others, to try multiple approaches and to visually inspect images. I hear this is something that is a general recommendation to trust but verify in neuroimaging. We thought about, why was it that flirt didn't perform that well in this case, and there are many, many possibilities. And of course, we have to try to evaluate these possibilities and try to see what works and what doesn't. It may be due to non-brain issue, it may be due to the fact that we register on the raw data. And of course all of these things can be checked and verified. In general, we think that visual inspection after registration is a very important thing to do. And also having multiple options, in this case the multiple options are exactly two and FSL. [SOUND]