0:13

So this is Theme 4, Lecture 9.

Â So, getting anatomic information from the ROI and the atlas together.

Â So, in the last lecture, we took the ROI and we put it in the template space.

Â So now we have the ROI in the template space and

Â we have the Eve template, which also has an associated atlas.

Â And the atlas has segmentation for a bunch of the substructures and

Â a bunch of the structures in the brain.

Â So it's actually is a full brain segmentation that maps all

Â the voxels to a specific area.

Â So, now what we can do is cross-reference where the ROI is placed

Â in that template space.

Â With the manually labeled areas to say where is this brain tumor in words.

Â So, now with the ROI and the template again in the same space,

Â we can take the pre-labeled atlas.

Â And cross reference it with the ROI and

Â say where does the ROI live in the template space.

Â And then, we can use the labels from the atlas to say actually what structures or

Â what area of the brain it actually overlaps with.

Â So not only is the atlas segmented, it has actual clinical or

Â neuroanatomic labels to that.

Â So for example if somebody asked, where is this brain tumor?

Â You can say, maybe it's in the lateral part of the brain, the left, the right,

Â and so forth.

Â So, let's show you how to do that.

Â So first off, we are using the Eve atlas Type I,

Â there are a few different versions of this atlas, so we are just using the type one.

Â If you want to [INAUDIBLE] and download it, that's the one we are using.

Â But this should be located within your template directory, in the MOOC directory

Â in your virtual machine or in the data set that you downloaded.

Â So, it has a LUT, which stands for a Look Up Table.

Â So, the atlas is labeled with

Â labels one to about 100 and you need a Look Up Table to say.

Â This number one, where you have to look that up to find out

Â what area of the brain that is, that's why it's called a Look Up Table.

Â So we read that in R and we create a data frame.

Â So, the data frame consists of two columns, one being the index and

Â the second column being the label, right?

Â So, that index being on the atlas NIfTI image,

Â a voxel labeled zero for example as background.

Â One is the superior parietal lobe on the left side to the cingulate

Â gyrus on the left side, and so on and so forth.

Â So now every voxel in the NIfTI image has to be numeric, but

Â we can use this to actually say what that voxel.

Â What are of the brain that voxel is located in?

Â 3:50

So again, when we do transformations of images,

Â we usually have some sort of interpolation.

Â So I take your brain, or I'll take an image and I'll warp it around and for

Â example a binary mask.

Â So when we put that in a new space it's going to be located with the voxel

Â sizes and the dimensions in the template space.

Â What that means is, although the region of interest initially was binary.

Â We actually take it, warp it and we do some interpolation,

Â AKA some local averaging.

Â So we take an area of the brain, let's say we put it here and

Â what do we want to assign that voxel to?

Â Well, we take a local average of neighboring voxels to get

Â that voxel value in the template space.

Â What that means again is that the ROI in the template space

Â is no longer binary due to interpolation.

Â So, I did a histogram of the ROI

Â after it has been non-linearly warped to the template space.

Â Again, note that this would have happened with the affine registration,

Â a rigids registration to the template and so forth.

Â So actually, any registration where you 're changing the voxel dimensions in

Â the space generally will have some interpolation.

Â So you have to, if you want to create a binary ROI,

Â again, you have to do some thresholding.

Â So in general, a lot of recommendations for binary mass for rigid or

Â affine registration, or affine transformations.

Â They say it's maybe used around a 0.5 cutoff,

Â but we recommend to investigate the image in the template space.

Â Or in the transform space with different cut off's to see what gives kind of

Â reasonable results.

Â And this is that are easy to do with one image, sometimes it's harder to do it in

Â the entire pipeline of hundreds or thousands of images.

Â But, you want to at least do some double checks to make sure that

Â they overlap to what the area should be.

Â So again, now that it's not binary, we want to say where is this ROI?

Â So we can do one of two things and I would say one of the most common things to do,

Â is to do thresholding like we just discussed.

Â Or depending on what we're doing to just add up the voxel values.

Â So in some respects, because we're averaging zero to one's,

Â this can be thought as a proportion.

Â Or maybe a probability that this voxel is in ROI is brain tumor, right?

Â So, for example for the impact to the histogram,

Â 0.8 means that when you did some local averaging.

Â There was about 80% of the neighbouring voxels [INAUDIBLE], so

Â you can kind of think of it as a probability.

Â So sometimes for certain problems,

Â you way want a threshold, you may want to be able to just do a weighted sum.

Â Where you don't have to sets threshold agnostic,

Â it doesn't matter what threshold you use.

Â So here, what we're doing is creating another data frame and

Â I'll be using the plyr package, and I'll tell you why in a minute.

Â We're making another data frame, where we took the [COUGH] index.

Â Now corresponds to the voxel we take syn_roi greater than zero.

Â So all the voxels of the ROI in the template space that are greater than zero.

Â And we subset the labels, the atlas labels and we call that index and

Â then we took the again just the actual values of the ROI.

Â And so now you have a data frame with two columns one saying,

Â what is the value of the voxel of the ROI?

Â And the template space and then what is the associated label on the atlas?

Â So now I use ddply from the plyr package to say roi.df.

Â So the data frame we just created and I want to go through each index.

Â So every single label of the atlas and

Â I want to summarize it in saying I want to add up all the the voxels.

Â All the raw intensities or

Â I want to add it up where only voxels are greater than 0.5.

Â And I'm actually not adding up only voxels greater than 0.5,

Â I'm saying if you're greater than 0.5 you're a one.

Â You already have ROI and

Â if you're not greater than 0.5 we're going to set you to zero.

Â So these represent slightly different things, but

Â they represent for each individual atlas label.

Â The number of voxels that were counted, so either a weighted sum or

Â the number greater than 0.5, okay?

Â And then, we'll actually merge this with the data frame that has the labels.

Â For example the cingulate and so forth, from the Look Up Table.

Â So now we can say of the actual image of the ROI,

Â where do these things lie, and what percentage overlap do we have?

Â So again, I'm just doing some simple book keeping and

Â sorting here to actually sort the data frames.

Â So if you actually do use this code and actually look at each operation.

Â All we are doing is some merging, some sorting just so

Â we can actually get to this last table, which I will show you.

Â The areas of the brain that are engaged by the tumor or the region of interest.

Â So for example,

Â the precentral gyrus on the left hand side is engaged by the tumor.

Â And so what we actually did is we normalized these columns, so

Â we took the column and divided by the column sums.

Â And that now each element in this table represents of

Â the entire ROI, what percent engages this area.

Â So for example, 15.6% of the brain tumor is in

Â the precentral gyrus on the left-hand side.

Â 12.9% is in the precentral white matter on the left-hand side.

Â And so one of the nice things that we see comparing left to right on each of

Â the rows, is that they relatively comparable?

Â So that, even if we use a threshold of 0.5 or you use the weighted sum.

Â You get generally the same results for

Â how much of the brain tumor's engaged by a certain region.

Â So this is really nice, so you can now tell clinicians that this patient.

Â For example, 9.4% of the brain tumor

Â was engaged in the superior temporal gyrus and so on and so forth.

Â And then, you can do more things, as in collapsing left and right labels or

Â collapsing larger areas, so on and so forth.

Â But this allows you to get to some clinically meaningful or

Â translatable answer.

Â 10:28

So, there are two ways that I believe we can describe this data.

Â So, either you say, the denominator is the total size of the ROI, or the brain tumor.

Â So, in some instances say, 15% of the brain tumor is engaged

Â by the precentral gyrus on the left-hand side.

Â The other way you can say,

Â if if you pre-specified areas that you're interested in.

Â So let's say the putamen or the insula, saying how much of the insula is

Â engaged by the region of interest, so that's a little bit different.

Â So in the first instance where the ROI, the description I just discussed,

Â the denominator is total number of voxels in the ROI.

Â In the other instance, it's the total number of voxels in that area,

Â the region, the neuroanatomic region.

Â For example, the insula or the putamen, all right?

Â So this code, it's a little dense and I would step through it very slowly but

Â the idea is, we're doing the same operation.

Â The only difference is, we're counting the number of voxels in each of the labels.

Â And then using that as a denominator to get this table, so

Â the interpretation of this table is a little bit different.

Â Saying that 46% of the superior

Â longitudinal fasciculus on the left hand side is engaged by the brain tumor.

Â Now, one of the things you should note is that areas or

Â regions that have smaller volumes.

Â Have a higher likelihood that you're going to get a large area of overlap.

Â But to clinicians and to some researchers, this is a more important measure.

Â And so for example 11.1% of the left side putamen is engaged by the ROI,

Â so this is just two ways to present your data.

Â So that it actually has some sort real life or

Â real neuro anatomic interpretation versus just getting the output muscular.

Â So that's kind of one step in the direction and

Â now you can do it on a population level, so on and so forth.

Â But this one, I think important thing that we want to do

Â when we have regions of interest on brains.

Â [NOISE]

Â