Transcription
Hello everybody and welcome back. Today I want to show you how we can generate these two seemingly very different images from the same data set that we've acquired during one single CT acquisition. Specifically, I want to introduce the concept of postprocessing. How we can take each and every pixel within this image and allocate a numerical value to that pixel. That value is what's known as a CT number or a Hounsfield unit. And I'm going to show you how we go about calculating those Hounsfield units.
We then can take the Hounsfield units for each and every pixel in in this image and match those units to a grayscale value. The matching process allows us to turn a numerical data set into an image that we can actually interpret. And the grayscale value, the way in which we match that grayscale to specific Hounsfield units, is what's known as windowing. And I'm going to show you how manipulating that grayscale window can make these different images here.
Now, before we've gone about postprocessing and making these images, a couple of steps have to have occurred before this process, and I want to touch on those now. Those steps are what we're going to concentrate on after we've gone through this talk. Now, we know that in this specific slice, we're looking at a brain here, a 3D model of the brain. We're looking at a specific axial slice, a volume of tissue within the patient. This 2D image that we're seeing on our screen represents a volume, a 3D volume through the brain, and each pixel corresponds to a specific voxel, a volume element in the patient.
Now, we know in order to acquire the data for this specific slice, the CT machine has to rotate at least 360 degrees around the patient and generate different projections. And it's the data that we are reading through the detectors here that we're going to use to mathematically calculate the image here. Now, when the CT machine is acquiring the data, it's getting an analog signal that needs to be converted into a digital signal. And then we need to pre-process some of that data. We've talked about interpolation. We might want to account for faulty detectors. There's a lot of pre-processing that happens that then gives us raw data. That raw data can be reconstructed, and it's that reconstructed data that we're going to use to ultimately convert into Hounsfield units. And that process of reconstruction is going to be the topic of the next three talks.
Now, there are two key data measures that the CT machine needs to acquire. We've talked about transmitted X-rays, X-rays that have passed through the patient, been attenuated as they pass through the patient, and then hit our detectors. We also need a reference intensity of the X-ray beam. What is the intensity that we are projecting towards our patient? And we can measure that on detectors where that X-ray beam hasn't passed through a patient. And it's the difference in the intensity that we're projecting towards the patient and the intensity that's actually being measured on our detectors that's going to help us determine the degree of attenuation as X-rays are passing through a specific line through the patient.
Let's look at specific voxels here. We've got a red voxel here that's on the insular cortex. We can see it here in relation. And we can see a separate purple voxel here that's going to be in the white matter of the forceps minor here. Let's look at this specific slice here, and I'm going to look at this pixel here, the purple pixel. Ultimately, we need to figure out how much attenuation of the X-ray was due to the tissue within that specific voxel here. And that process occurs during reconstruction.
Let's take a fictitious example here where we've only got this voxel of tissue with X-rays passing through it. It hasn't passed through tissue beforehand, and it hasn't passed through tissue afterwards. The incident X-rays will hit this specific voxel and then head off towards our detector. In this example, say we've got 100 X-ray photons, all of the same energy, then hitting our voxel of tissue. A degree of attenuation is going to occur, and that attenuation is either through the photoelectric effect or it's through scatter. Scattered X-rays aren't going to reach that detector in that line of the X-rays, and that scatter can be Compton or Rayleigh scatter. A certain fraction of those X-rays will be attenuated, and the rest will be transmitted. In this example, 10% of the photons have been attenuated.
The fraction of attenuation for a monochromatic beam over a known distance is what's known as the linear attenuation coefficient. The linear attenuation coefficient is represented by this symbol, mu. I put a subscript P because we're talking about the purple pixel in our example. So, the linear attenuation coefficient tells us what fraction of these X-rays will be removed from a monoenergetic beam over a known distance. So, we know the pixel width here. Now, the linear attenuation takes the combination of both the attenuation due to the photoelectric effect, the Compton scatter, and Rayleigh scatter. We add up all that attenuation to get this linear attenuation coefficient value.
Now, the linear attenuation coefficient is dependent on a couple of things. The first, it's dependent on the energy of the X-ray beam that's heading towards our tissue. Higher energies will result in less attenuation. It's more likely that X-rays will pass through that tissue because of those higher energies. We've looked at the likelihood of the photoelectric effect; it drops off rapidly as we increase incident X-ray energy. So, an increase in incident X-ray energy is going to result in a decrease in the linear attenuation coefficient in this tissue, despite the tissue remaining the same. It's also dependent on the density of the tissue here. The more atoms that we have per cubic centimeter, the more likelihood there is going to be of having photoelectric or Compton scatter interactions. The same goes with the atomic number of the tissue. The higher the atomic number of the tissue or the material, the more likely there's going to be attenuation. If we take iodinated contrast, for instance, that's got a much higher atomic number than the average atomic number of tissue. And the last factor that it's dependent on is electron density. Now, when we're looking at tissues and CT imaging, this doesn't actually come into play as much as it would, say, in experimental studies. The tissue density and the atomic number of the tissue play a large role in what linear attenuation coefficient is going to be ascribed to each pixel or each voxel within our image. If we were to look at our red pixel, for example, here, that attenuation could be different, even though we've got the same monochromatic X-ray beam heading towards that tissue. That's based on the different tissue density and different atomic number of that tissue here. We've got 20% of the X-ray photons being removed.
Now, we know that attenuation is not happening in a single pixel. It's happening in multiple pixels, more specifically happening in multiple adjacent voxels as those X-rays are passing through the patient. Let's look at this example here, and I want to show you why the term "linear" here can be quite confusing. In this example, after the X-rays have traveled a set distance here, we've lost 20 X-rays, or 20% of the X-ray photons here. If we were to place the exact same voxel of tissue here adjacent to our previous voxel, we will get a 20% reduction in the intensity of the X-ray photons here, but the absolute number difference is now 16, not 20. We can repeat this process by placing the same voxel adjacent to the next voxel, and you'll see that each time that voxel of tissue is attenuating the X-ray beam by 20%, but our absolute number of X-ray photons that are being reduced is smaller and smaller as we move on. Here, we're getting a reduction of 13 X-ray photons and 10 X-ray photons, and we can see that represented on the graph here. This graph is showing us how the absolute number of X-ray photons, as they're passing through a set volume of tissue, reduces in an exponential fashion, or negative exponential fashion, rather than a linear fashion. The linear part here means that the fraction removed is the same.
Now, we can represent this photon loss using this formula here. N naught here, with the subscript naught, is the X-ray intensity, or the number of X-ray photons that are being released from the anode of the CT machine heading towards our patient. And N is the intensity, or number of X-ray photons that are actually measured by our detector. This part of the equation here is showing us what fraction of these incident photons are being removed from the beam, and that will allow us to see what the remainder that is being transmitted towards our detector. The linear attenuation, as that increases, it's going to decrease the value of this fraction. We're going to get a smaller percentage of X-ray photons being transmitted. The same with increasing the distance. The further we travel through a tissue, the more attenuation there's going to be. Ultimately, the number of X-ray photons reaching our detector is going to be lower.
So, in this example, I can calculate a linear attenuation coefficient for these specific voxels of tissue. This is assuming that these are 1 cm wide; it's just easy for my calculations here. Now, importantly, we can take this exact same voxel of tissue; it's got the same tissue density and it's got the same average atomic number, but we can change the linear attenuation coefficient by reducing or increasing the incident X-ray photon energy. If we were to send a much lower intensity beam towards these voxels here, we could get a linear attenuation coefficient that's much different for the same tissue. That difference here is purely based on the differences in photon energy. With lower photon energies, we're much more likely to get the photoelectric effect, specifically, but also more likely to get Compton and Rayleigh scatter, and that results in more X-rays being removed from the beam. In this example, we're getting 50% of the X-rays being removed through each volume of tissue here.
Now, importantly, when we're looking at clinical examples, we haven't got the same voxel of tissue adjacent to one another. We've got multiple voxels of tissues, all with differing tissues, differing tissue densities, and different average atomic numbers. So, we're passing through a volume of tissue with adjacent voxels here, and we know that this volume of tissue ideally will be within the field of view of our CT machine. We talked about how we calculate that field of view. We've got X-rays of a certain intensity reaching that volume of tissue and then exiting towards our detector. Now, these linear attenuation coefficients of adjacent voxels are different from one another, and we need to manipulate this formula because now we don't have a single linear attenuation coefficient, but we've got multiple linear attenuation coefficients.
Now, this is a known value. We know the incident X-ray intensity and we know the transmitted X-ray intensity that's being detected by our detectors. We also know this distance here, the field of view that we've calculated before. This is the distance that we're trying to accurately calculate linear attenuation coefficient values for, and this we can represent by the term X here, X being the width of each individual voxel that we're trying to calculate, and N being the number of voxels within that total width. So, we can now rewrite this equation like this. We know these values here, we know the pixel width, and now we can add up all these linear attenuation coefficients. We can rearrange this formula. I don't want to get too much into it, but here we've rearranged the formula, and we've got our variables on one side of the formula, and we've got our known values on the other side of the formula. This is going to be a numerical value that we can actually use to reconstruct these images.
The goal of reconstruction is again to make multiple simultaneous equations from all the different projections that we've generated around 360 degrees around the patient and then solve for these variables using the simultaneous equations. Now, for now, I'm not going to talk about how we go about solving those variables, but suffice it to say that for each voxel within our image, we can accurately calculate the linear attenuation coefficient in that voxel. I'm going to show you some examples here now. Remember, these linear attenuation coefficients are specific for the scan that we're doing, specific for the energy of the beam that we're sending towards our patient. If that energy of the beam, the average energy of the beam, were to change, these linear attenuation values will change also. It's important to note that these linear attenuation values are not going to be the same for all fat within the body. Visceral fats or subcutaneous fats are going to have different densities, and between patients, we're going to get different densities. We know that people have different bone densities depending on their age or depending on their sex. So, these are just examples here; you don't need to learn these here.
Now, what if we take these linear attenuation coefficient values? We've made an array, say a 512 by 512 pixel array, and we've placed the linear attenuation coefficient in each one of these pixels. Can't we then convert those to a grayscale and make an image? Well, let's do that. Let's get a grayscale from black to white here, and all the grays in between. We make our lowest linear attenuation coefficient, air, we make that black, and we make our highest, bone, we make that white. If we were to place all of these tissues here on the scale, they'd all be very close to one another. The difference between fat and between gray matter, sorry, this is white matter and gray matter, is only 0.022 here. There's a problem when it comes to the scale. If we were to try and generate this image, it would end up looking like this: very little useful clinical information here. Our bone is all blown out. We haven't got much differentiation in our bone. We can't see the outer table or the inner table of the skull bone here. We can't even see the sutures. We've got no useful information there, and we can't tell really anything about the gray and white matter that's sitting within the cerebrum here.
There's another issue here, is that the difference between the linear attenuation coefficient of air and compared to say, water, is about a thousandfold difference. It's a thousandfold difference here. The difference between water and bone is about a two and a half fold difference. So, the scale is all off here, but that's not our biggest issue here. The biggest issue when it comes to using linear attenuation coefficient values and translating them directly into an image is that these values are going to change depending on the X-ray intensities that are incident on the patient. I've said that a couple of times now. Now, why is that important? Well, the linear attenuation value change is different for different tissues. In bone, we get a lot more photoelectric effect than we do in say, soft tissue. So, if we increase X-ray intensities, we're going to get a rapid drop-off in attenuation through bone, and that's not proportional to the drop-off in attenuation in soft tissue. What we want to do is somehow standardize these values to a single value, and that's exactly what we're going to do. So, we're going to change the scale and we're going to standardize these values.
How do we go about doing that? Well, we want to convert linear attenuation coefficient values into CT numbers or Hounsfield units. Now, in order to convert these numbers, we use this formula here, and it's simple if you go through it. The Hounsfield unit for a specific voxel of tissue, we take the calculated linear attenuation coefficient of that voxel and we subtract the linear attenuation coefficient of water, dividing that value by the linear attenuation coefficient of water. What this does is it standardizes the linear attenuation to water, so everything is in reference to water. Now, why is this important? Well, we can do an experiment where we place water within the CT machine and we measure the attenuation values. Now, we've got a reference value. It's a way of calibrating our CT machine. We can then take the calculated value here, say of white matter, and enter it into this formula, getting a Hounsfield unit value. If we were to only use this part of the formula, we would again be dealing with decimals to the third or fourth decimal place, and that's why we multiply this by a constant. We multiply it by a thousand, so we're dealing with whole numbers here. It's much more usable, it's much more user-friendly. That's the value of this constant here. We standardize that linear attenuation to water.
Now, what if there was water in that voxel itself? Well, water's linear attenuation will be the same here. The top, our numerator of this equation, would be zero. Our Hounsfield unit for water will always be zero. Now, that's really handy because anything that has a positive Hounsfield unit value is going to be more attenuating than water, and everything that has a negative Hounsfield unit value is going to be less attenuating than water. So, we've got a standard point. Water's Hounsfield unit value is always going to be zero. We can then plot those Hounsfield unit values on a scale. Now, remember, if the X-ray intensity changes, water's Hounsfield unit value is not going to change. The Hounsfield unit values for the other tissues are going to change ever so slightly, less drastically than our linear attenuation coefficients because we've now referenced them or standardized them to water. Air is also a value that changes very minimally because air's linear attenuation is so low. This here, this part of the equation, is very close to minus one.
Okay, so now we've converted our linear attenuation coefficient values into CT numbers or Hounsfield units. You can see these round numbers; they're much easier to deal with than these multiple decimals here. And we can see that the changing of Hounsfield units, just a couple of Hounsfield units, is going to represent a very small change in the actual density or linear attenuation coefficient here. And that small change, we can link to a grayscale value and see those differences. So, let's try and do that. Let's bracket the tissues that we actually want to see in our image. Let's go from air to bone. Now, importantly, if you used the bone calculation here, you're going to get a value that's higher than a thousand. I've just used a thousand here because that's often a reference standard for bone, and remember, these are always going to change, these linear attenuation coefficient values. We also want to set a midpoint. What's the middle of that range that we've selected here? And the middle of this range is going to be zero. You'll see why that becomes important later. And let's apply a grayscale value to these Hounsfield units.
Now, the process of applying this grayscale value to the Hounsfield units is what's known as windowing. Windowing is what's going to manipulate or postprocess our image. There are two key points when it comes to windowing. The first is what's known as window width: what's the range of Hounsfield units that we want to represent within our image, within the grayscale part of our image? The second is what's known as window level: what's the midpoint of that window width that we've selected here? The example, zero. Now, we can take those Hounsfield units that we have in an array of our image and convert them to actual grayscale values that we display on the screen and generate our image here. Again, this image is slightly better. We can see some more contrast within the bone here, but there's still very little contrast within the cerebrum here.
Now, what happens if we want to see the differences in the cerebrum? What if we want to see where the CSF is in relation to the brain, or what if we want to see differences between white matter and gray matter? We're going to need to change this window. Now, why do we need to change this window? Can't we zoom in here and maybe click on it and see what the differences are? Well, the human eye can only really interpret 30 to 50 shades of gray. Different. And here we're dealing in an 8-bit system with 256 different shades of gray. 256 shades of gray spread out over 2,000 Hounsfield units, only every seven or eight Hounsfield units are we going to get a change in a shade of gray, and we can see here that these Hounsfield units are very close to each other. The human eye is not going to be able to interpret these differences. So, to get around this, what we do is we narrow our window. We want the contrast to occur over a smaller range of Hounsfield units. This comes at a compromise, though. Everything in this example above 80 Hounsfield units is going to appear white in our image. Everything below zero Hounsfield units is going to appear black. Fat and air are going to look exactly the same; they're going to be black. Water is going to be black.
Now, what's happened to our window width and our window level? Our window width now is 80 Hounsfield units, and our window level is going to be 40 Hounsfield units. You can see how the level describes where we are along this scale, and the width describes how wide we are covering, how many Hounsfield units we're covering. This is what's known as a brain window. And look what happens to our image when we apply that brain window. There's a drastic difference. Now, let's look at what's actually happened. Our bone has been blown out; it's white. We can't tell the difference between the outer table and the inner table and the spongy bone between them. We've got much more contrast detail between our white matter and our gray matter because of this narrowed down window. Look at the difference in the grayscale values, even between such small changes in Hounsfield units. The fat, we can no longer see the subcutaneous fat here. Look how it just looks like the patient's head ends in bone, and then it just goes out to air. If you look at our previous image, you can see that subcutaneous fat there because fat was included in our grayscale. It's now no longer included. We can still see the temporalis muscle because that's sitting within the Hounsfield unit window here. And depending on the clinical question we're trying to ask, we can change this window in multiple different ways. In the abdomen, we're going to be using very different windows to what we're using in the brain.
Now, in the question bank that I'll link below this talk, I'm going to leave for you reference slides showing the different windows that we use, and I'm going to link these cases so you can play around with the window yourself. This window that I've changed to now, you see we've got a wider window. Everything below 400 is going to be black. Our window width is now 1,400, and our window level is going to be 300. 700 above, 700 below. Look what that does to our image. We've now created a bone window CT. We want to keep air black because it's important in bone window CT to see if we've got pneumocephalus. We want to be able to see air within the cranium if we've got fractures within the bone. See how we can see the sutures now better? We can see the lambdoid suture here. So, the window allows us to answer different questions, allows us to get contrast in the tissues that we're interested in.
So, hopefully, you can see how we go from that raw data acquisition, there's some form of calculation that happens that gives us linear attenuation coefficient values, and we now know what those linear attenuation coefficient values represent. We also know how to convert those using this formula here into CT numbers or Hounsfield units, say the same thing. We can then take those Hounsfield units, place them on a scale, and then put a grayscale that matches those Hounsfield units, and where we place those grayscale values and how wide that grayscale is is what's known as windowing, and will manipulate our image.
Now, why have I talked about this prior to talking about the pre-processing and the reconstruction? Well, the calculations that go into actually figuring out what the linear attenuation coefficient in a voxel is is a little bit more complicated than I may have suggested. In theory, the answer seems simple. We generate multiple attenuation data points from different angles around the patient. We got projection data from all those different angles, and then we back-calculate, we calculate those simultaneous equations, we figure out those unknown variables, and then we use those to do what we've done in this talk. It's a little bit more difficult than that in practice. This was the example that we looked at first. Now, there are two key differences in real life. We don't create a monoenergetic beam, say this one that we were looking at. All those X-ray photons had the same energy. We create a polychromatic, a polyenergetic beam that has an average intensity. This is the quality of the X-ray beam. The number of photons in the X-ray beam is the quantity of the X-ray beam. Now, if our linear attenuation coefficient was the same as what we looked at before, we would see that we'd get 80 photons coming through. But what's happened here? We preferentially attenuated lower energy X-rays. We know that attenuation happens more at lower energies, therefore, the average energy of our beam has increased. If we were to place another voxel of tissue here, what's changed? The average energy has changed. We know that with higher incident X-ray energies, we're going to get a lower linear attenuation coefficient. We're going to reduce the fraction of X-rays that we are removing from this beam. The beam then, as a result, has a higher X-ray energy, a higher average energy. And as this process continues, we proportionately remove a smaller and smaller fraction of X-rays whilst our beam is simultaneously having a higher average energy. And if you think about this across the entire length of a patient, the average energy of the beam can change quite a lot. This is what's known as X-ray beam hardening. The absolute number of X-rays as well as change that reaches our detector. So, that value that we are that's reaching our detector is not perfect for the linear attenuation that's happened through our patient. It's quite quite hard now to solve that simultaneous equation with an incorrect answer. Not only that, but we can have scattered X-ray photons that are coming from different areas but are contributing to the linear attenuation that we're calculating in this specific line across our image. So, scatter, in combination with beam hardening of a polychromatic beam, is going to make the calculation much more difficult. You know that in order to solve simultaneous equations, we need very accurate answers. When we're using this formula here, or rearranging this formula here, our answers are going to vary as we rotate around the patient. The degree of beam hardening is going to be different. We're going to pass through different lengths of bone, different widths of tissue, and that really muddles the data.
Now, this is one point where I'm really grateful for the physicists that have come up with CT imaging with reconstruction of data. They've somehow managed to design systems that can still calculate, or at least very accurately estimate, the linear attenuation coefficient in pixels without needing extremely accurate data. And those are the processes that we're going to look at in future talks. The reconstruction processes, we're going to look at simple back projection and filtered or convolution back projection. We're going to look at iterative reconstruction and FBP-based methods, and how physicists have got around this point, how they've managed to use really messy data but still create accurate images. So, if you're interested in that, join me in the next talk. Until then, goodbye everybody.