IR CT/Ultrasound Week 6

Hunter Spivey and Aayush Gupta

 

This week we finished taking scans with our CT scanner and were able to characterize it’s performance on different phantoms and different settings of fan angle increments. We successfully reconstructed sinograms and images for these different cases, and finished our work with our IR CT. We also were able to make the mixture for the ultrasound phantoms and let it cure and solidify. Since we finished our phantom, we moved onto making our T/R switch for our ultrasound, and got a start soldering the components onto the switch itself.

Phantom 1: 1 Degree Increments

Reconstructed IR CT Class Image

Phantom 1: 2 Degree Increments

Reconstructed IR CT Class Image 2 degrees

Phantom 2: 1 Degree Increments

Reconstructed IR CT Class Image phantom 2

Hopefully next time we can finish our T/R switch and move onto the other parts of the ultrasound scanner if we have time.

Question:

What happens if you more coarsely or finely sample the fan beam angles?

Answer:

By doubling our fan rotation increment, and therefore cutting the number our projections in half, we noticed a significant drop in resolution of the final image. whereas before we could clearly distinguish the 8 different pegs, the more coarse acquisition was difficult to identify starting at the 6th largest peg. If you need to trade resolution for acquisition time however, and the loss of resolution isn’t important for your intended purpose, then it is a valuable method to increase acquisition speed.

 

 

 

CT Scanner Week #6 – 2/15/2020

 

Week 6

Javier and Nicholas J. Holden

Sadly, this is our last week looking and working with our homemade CT machine before we decided it needed to be destroyed. We ran our last data collection on several different phantoms for the report. We felt accomplished because we had tangible results. We tried to fully reconstruct the image but ran into some problems because the resulting image looked nothing like our phantom. After speaking with the Professor, we realized that we had incorrectly measured our dcm. Our previous thought was that it was the distance from the middle to the photodiode; however, it is the distance from the middle to the servo motor. We also played around with our servo center angle to try and correctly align our sinogram to the middle. Figure 1 demonstrates the finished sinogram. Notice how it is nicely aligned in the middle of the window. Figure 2 illustrates the reconstructed image of the phantom.

We also began our ultrasound lab. Our mold that was created last week turned out fantastic. The ice bath contributed to the success because of the lower temperature we were able to achieve before we stopped stirring. We also began to solder pieces to our electric board. I cannot begin to describe the frustration that Javier and I (Nicholas J. Holden) experienced when trying to solder the inductor to the board as it was a small and easily breakable component. Eventually, we were able to correctly solder it and were able to finish the TR switch. We still need to test the switch to ensure the TR switch is functioning like expected. 

 

Question: What values do you get for L and C? 

Answer: 1.59μH for the inductor and 636.5pF for the capacitor

Question: How close can you get to these values with the components we have (without, e.g. using multiple components in each position)?

Answer: We were able to get 1.5μH inductor and a 680pF capacitor.

 

Figure 1 – The sinogram

Figure 1

 

Figure 2 – Reconstructed image of our phantom

19202_phantom

IR CT Week #5 Update 2/11/20

Antonio Glen, Hannah Kilpatrick and Danielle Liu

 

Update #5 Finishing the Infrared CT and starting Ultrasound

Last week, we continued to optimize our reconstruction. The final data set we made still resulted in a distorted reconstruction image, shown below. The sinogram for the data looked accurate, but was blurred around the edges. We believe slowing down the acquisition process in the future will all of to get a smoother sinogram and a more accurate reconstruction.

We also began to make agar phantoms for the ultrasound project. We mixed agar and graphite powder with water, microwaved the solution, and mixed it until it went down to 50 degrees Celsius. Then, we placed a 3D printed mold into the solution to finish making our phantom.

Questions

What parameters of your scanner and scan method influence resolution? Investigate these. 

The angle of the servo motor and speed of rotation.

 

sinogram

Figure 1. Sinogram

reconstructed image

 

Figure 2. Reconstructed image from sinogram

CT Scanner Week #5 – 2/11/2020

Week 5

Javier and Nicholas J. Holden

This week was spent focused on collecting and reconstructing the data. Luckily, our machine appeared to be functioning correctly, and no adjustments were needed to the machine.

We decided to collect data in two ways: two sweeps with our servo while our stepper is rotating at 60rpm and then one sweep with the servo. When there’s two sweeps, the ctRecon template image looks like a mirror image. Instead of trying to do some fancy math, we decided to collect the data in the two prescribed ways. It makes the math and future reconstruction a little easier.

We also changed the phantom to ensure that our code was running accurately and the data collected was changing with each phantom. Unfortunately, we experienced an issue with our servo / arm in that it could not move backward on the metal arm overhang. This meant we were not allowed to photo larger phantoms because there physically wasn’t enough space. The issue appeared to be that the person who configured the metal arm had hammered in a nut to a bolt and NOT a slider. Such brute force resulted in the slider unable to move backward. After an annoyed sigh, we decided to replace the phantom with a smaller one. While running the program on the replacement phantom, we made our own homemade auger phantom. To ensure we were protected from the graphite particulates and the Coronavirus, we wore masks. 

After microwaving the mixture, we had to continually stir it and wait for the temperature to decrease. Figure 1 illustrates this action by Javier. It was imperative that the two substances didn’t separate. We decided to create a bucket of ice to place the mixture in because we needed the auger/graphite mixture to reach a low enough temperature; this was important because we wanted to stop stirring while ensuring that there was minimal separation with the graphite and auger powder. As seen in Figure 2, we McGuyver’d the contraption. A dead battery was placed on top of the phantom in an effort to submerge it more into the liquid mixture. Afterwards, we placed tape everywhere and left it in a bag. We are excited to see what will happen to our device next week.

Figure1Figure 1 – Javier stirring the graphite/auger mixture

Figure2

Figure 2 The graphite/auger mixture inside a bag. The white dead battery is visible on top  of the orange phantom that was submerged into the liquid

Question: The servo has an extra (white) wire on it, that reads out its built-in position potentiometer, which you can use to record the servo’s actual position (rather than just its intended position). Is your image reconstruction improved by using this value instead of the intended value?

Answer: This would provide a more accurate measure of the servo angle but would require making sure that the servo is actually hitting all the positions in order to form the image. This may happen if there is something wrong with the servo and it is actually not hitting the right positions and would be visible with potentiometer voltages.

 

Infrared CT Update 5: February 11, 2020

Morgan Kinney, Tanner Hoppman, Jude Franklin

This week we were able to complete the assembly of our scanner and the code to run it so that we could acquire the projection data for our first image reconstruction. The Matlab code used for the reconstruction (Fig. 1) was a modified template designed to work for these IR CT scanners, but in the reconstructed image (Fig. 2) it is impossible to tell which phantom was used. This poor image quality was likely a result of either our method of acquiring the projection data, the reconstruction algorithm, or some other external influence on the system. In any of these cases, we hope to resolve the issue and complete scans and reconstruct images for all the different phantoms with reasonable image quality by the end of the next week.

 

Figure 1. MATLAB code for fan-beam reconstruction of real projection data

% recon data from an ir ct scanner

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% load the projection data

%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

% full phantom data – acquired over 360 degrees of stepper motor

load servoangle; % data file you generate – needs to contain diodeVoltage, servoAngle, and stepAngle

load step

load voltage

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% recon parameters

%%%%%%%%%%%%%%%%%%%%%%%%%%%

N = 200; % matrix size

FOV = 14; % cm, FOV of image matrix

Dcm = 6.9; % cm, distance from fan beam vertex to center of stepper motor shaft

D = Dcm*N/FOV; % vertex->center distance in pixels

fanCenterAngle = 80; % fan center angle 

fanAngleWidth = 90; % total width we need in degrees for the fan beam to cover the object

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% subtract off the center fan angle from the servo angles, to center them

%%%%%%%%%%%%%%%%%%%%%%%%%%%

servoAngle = servoAngle – fanCenterAngle;

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% reshape data into a fan beam sinogram matrix. We assume that servo angle

% is minor dim in diodeVoltage vector

%%%%%%%%%%%%%%%%%%%%%%%%%%%

nServoAngles = length(unique(servoAngle));

nStepAngles = length(unique(stepAngle));

fanBeamData = reshape(diodeVoltage,[nServoAngles,nStepAngles]);

 

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% interpolate along the fan beam dimension to center the data

%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

% find increment between servo Angles

deltaServoAngle = abs(diff(unique(servoAngle)));deltaServoAngle = deltaServoAngle(1);

% find increment between stepper motor angles

deltaStepAngle = abs(diff(unique(stepAngle)));deltaStepAngle = deltaStepAngle(1);

 

% get input (I) and output (O) interpolation grids

servoAnglesI = min(servoAngle):deltaServoAngle:max(servoAngle);

stepAngles = min(stepAngle):deltaStepAngle:max(stepAngle);

[stepAnglesI,servoAnglesI] = meshgrid(stepAngles,servoAnglesI);

servoAnglesO = -fanAngleWidth/2:fanAngleWidth/2;

[stepAnglesO,servoAnglesO] = meshgrid(stepAngles,servoAnglesO);

 

% do the 2D interpolation to the centered grid that we will use for recon

fanBeamDataCent = interp2(stepAnglesI,servoAnglesI,fanBeamData,stepAnglesO,servoAnglesO,’cubic’,0);

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% reconstruct the image

%%%%%%%%%%%%%%%%%%%%%%%%%%%

img = ifanbeam(fliplr(fanBeamDataCent),D,’fancoverage’,’cycle’,’fanrotationincrement’,…

    deltaStepAngle,’fansensorgeometry’,’arc’,’fansensorspacing’,1,…

    ‘filter’,’Ram-Lak’,’frequencyscaling’,1,’interpolation’,’nearest’,…

    ‘outputsize’,N);

figure;imagesc(-img);axis image;colormap gray

 

Figure 2. Reconstructed image from real projection data

image

Question: What parameters of your scanner and scan method influence resolution? Investigate these. 

Answer: Our resolution for these IR CT scanners is determined by the data acquisition rate set by the arduino, the step angle of the servo arm, and the step angle of the stepper motor. Assuming that the arduino baud rate is sufficient, the stepper motor would be the limiting factor of resolution because it has a minimum step angle of 1.8 degrees while the servo arm can move just 1 degree per step.

IR CT Scanner Week 5

Blog Post Week #5

Aayush Gupta & Hunter Spivey

 

This week we were finally able to reconstruct the data obtained from the Arduino and obtain a reconstructed image from the stepper and servo data of our CT scan. The MATLAB code used to parse the data and produce an image is displayed below, with appropriate comments included:
Matlab Code Week 5 #1

Matlab Code Week 5 #2

Matlab Code Week 5 #3

A problem we faced while trying to produce our reconstructed image was that initially we set our stepper motor to record 201 voltage values per revolution instead of 200, which led to a sinogram that was tilted. After we realized our error, we modified our code and got the image below for our phantom:

Reconstructed IR CT Class Image

The question that we sought to answer this week were:
Q: Do all the features in your phantom images have the correct size? If not, why? Are their sizes accurately represented in all dimensions?

A: No they do not, our reconstructed image is a phantom that is significantly less geometric than our original phantom- our original’s dips and crevices were much straighter than shown in the reconstructed image. However, for the most part they resemble one another, with the only difference being that the image was not as detailed and did not include many of the more difficult detail

 

Hopefully next week we can quantify image errors discretely and discern to what extent our reconstruction correlates to the original phantom.

IR CT Week 5 Update

This week the group imaged a new phantom and tested changes to the image reconstruction parameters.  Ultimately the tweaking of parameters led the group back to their original inputs as shown in the week 4 blog post.  The baud rate was also adjusted to 14400 to smooth the motion of the servo motor but no improvement was noticed in image quality.  Attached below is the new phantom and resulting image output.  The larger phantom caused issues with resolving the image closer to the edges of the field of view and resulted in blurrier imaging of the posts that in prior phantoms which were smaller and more centrally concentrated.

Fig 1.The new phantom to be imaged

IR CT new phantom real

Fig 2. The resulting IR CT image of the new phantom

IR CT new phantom

Question:

What happens if you more coarsely or finely sample the stepper motor position?

The increase in number of polar steps from moving the stepper more finely results in a higher resolution image with more data points.  If moved more coarsely then the resultant image has fewer data points collected and therefore a lower power to resolve small objects.

 

Blog Post Week #5: Imaging Instrumentation Infrared CT Lab

Jorie Budzikowski, Stephanie Molitor, and Rachel Welscott

This week we were able to work on:

  1. Imaging various phantoms
  2. Changing image collection parameters including step size, light around the detector, field of view, etc.

1. Imaging Various Phantoms

Last week we were able to complete our servo, stepper motor, and Arduino code. We also were able to complete the image reconstruction of our first phantom. This week we aimed to continue to gather data with different phantoms and altered parameters on the image reconstruction script including the field of view, fan angle width, and distance from the center of the phantom to the servo motor to get a clear image. Some of the relevant image parameters we aimed to investigate were the image resolution, the smallest detectable line pair, image artifacts, and image scale size. The actual code changes for this week are minimal, but the changes to the sinogram and the corresponding phantom image were significant.

We were able to make reconstructions of three different phantoms, shown below. The overall quality of these reconstructions is decent, as we were able to discern the general shapes and spacing. However, some distortions were present, such as blurring of edges that turned square shapes more round. Additionally, we found the second phantom (middle image below) produced the least clear reconstruction. We found that this was due to the outer four pegs blocking the IR light from the inner pegs. Since our CT scanner only took images in one direction at a time, this altered our final reconstructed image.

different phantoms

Image 1: The three different phantoms we were able to produce images of using our Infrared CT scanner system.
2. Changing Image Collection Parameters
We also changed the step size for both the servo and the stepper motor to determine how the step size correlated to image resolution. We changed the servo step size from 1 to 5 degrees, and changed the stepper motor from 1.8 to 3.6 degrees. We were able to change the step size very easily, by only changing one value in our Arduino code, as shown below. We determined that an increased step size for both the servo and of the stepper motor resulted in a decreased image resolution, as illustrated in the following image reconstructions.

bad recons

Image 2: Increasing the servo step size (left) and increasing the stepper motor step size (right), both had the effect of decreasing image resolution.

servo

Image 3: The Arduino code, showing the parameter changes to alter the step size of the servo from a step size of 1 (top) to a step size of 5 degrees (bottom).

stepper

Image 4: The Arduino code, showing the parameter changes to alter the step size of the stepper motor from a step size of 1.8 (top) to a step size of 3.6 degrees (bottom).

The next parameter we changed was the lighting around our detector. We were working by the window, so we found that the generated sinogram showed different colors on the window side and classroom side of the image. This would impact the resolution of our image reconstructions by changing the grayscale coloring of the phantom. By covering our CT scanner with jackets to block the light during the collection, we were able to eliminate this variability in coloring of the image due to the lighting and produce a more consistent ambient environment signal.
Additionally, one of the artifacts that we noticed in our reconstruction was a dark ring around the outside of each phantom (see Image 1). We believe that this was due to a high level of noise at the upper end of our fan angle. This is easily seen by the blue stripe on the far right of our sinograms. By cropping the fan angle in our reconstruction to only capture the bulk of the sinogram, we were able to make this dark ring less apparent.

sinograms

Image 5: Two sinograms produced from an unlit (left) environment and an environment with ambient light (right). Both sinograms feature a dark blue stripe on the far right, which is what produced the dark ring around our image reconstructions.

The questions that we aimed to answer in this lab are as follows:

  1. What is the smallest feature or line pair that you can resolve?
    1. The smallest gap between phantom pegs that we were able to resolve in our image reconstruction was measured to be 0.445 inches.
  2. What happens if you more coarsely or finely sample the fan beam angle and/or stepper motor positions?
    1. Last week, we hypothesized that a smaller step size for the servo and stepper motor would produce finer spatial resolution. This week, we were able to test our hypothesis and found that we were correct, as increasing the step size of each resulted in a very poor image reconstruction.

Infrared CT Update 4: February 4, 2020

Morgan Kinney, Tanner Hoppman, Jude Franklin

This week we spent much of our time troubleshooting an issue with an unknown cause, which we finally resolved with the discovery that our IR LED no longer functioned. This issue was seen in the fact that our serial monitor did not output changing values as the the distance between our LED and diode was varied. Once confirming that our emitter-detector system was working and being measured properly, we programmed the arduino to print to the serial monitor the three values we will need for reconstruction: voltage measurement, servo angle, and stepper angle. We were also able to finish our reconstruction program in matlab and test it on sample projection data to obtain an image (Fig. 1-2). The last steps to being able to reconstruct to an image will be modifying the scan parameters for the servo and stepper motors to get the best image and transferring the data into Matlab.

Figure 1. MATLAB code for fan-beam reconstruction of sample projection data

clear all

load fanBeamProjectionData

theta1=reshape(stepperAngle,269,360);

voltage1=reshape(voltage,269,360);

[rad, xp]=radon(voltage1,theta1(1,:));

figure(1)

imagesc(theta1(1,:),xp,voltage1)

colormap(hot)

colorbar

 

N = 220; % matrix size

FOV = 10; % cm, FOV of image matrix

Dcm = 7.78; % cm, distance from fan beam vertex to center of stepper motor shaft

D = Dcm*N/FOV; % vertex->center distance in pixels

 

figure(2)

img = ifanbeam(voltage1,D,’FanSensorSpacing’,.5,’OutputSize’,N);

imagesc(img);axis image;colormap gray

 

Figure 2. Reconstructed image from sample projection data

samplerecon1

Question: Which way does your photodiode need to be oriented to get a positive output voltage?

Answer: The photodiode needs to be oriented with the positive end connected to ground and the negative end connected to the inverting input of the op amp. This allows for the negative current through the photodiode to be powered by the op amp from the output to ground.

Feb 4th Blogpost

Alex Boyd, Maggie Ford, and Myron Mageswaran

 

The construction of the actual scanner was completed in previous labs, so the past week was spent mostly collecting data and then polishing the MATLAB code to try to improve the reconstructed image.  The first image collected (Image 1) was overall somewhat clear, but for a portion of the collection, the photodiode was unplugged, so the image contains a blurry spot from the incorrect data points.  Students then took another complete data set to use for the reconstruction. This new image (Image 2) was very clear, but had a bit of a ring around the object.  To correct this, students remeasured, adjusted, and tested the FOV and other parameters and used the best corresponding values.  

Screen Shot 2020-01-28 at 11.35.39 AM

Image 1: The first image students reconstructed using the data set that had the photodiode disconnected for a portion of time evidenced by the region circled on the right side

Screen Shot 2020-01-28 at 12.13.16 PM

Image 2: The new image students reconstructed using the complete data set 

 

MATLAB CODE: Below is the code that students used for the reconstruction of the images with comments to follow along

 

%Reconstruction of an Infrared CT Scanner

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% load the projection data

%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

% full phantom data – acquired over 360 degrees of stepper motor

load phantom2Trial1.mat; % data file you generate – needs to contain diodeVoltage, servoAngle, and stepperAngle

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% recon parameters

%%%%%%%%%%%%%%%%%%%%%%%%%%%

N = 20200; % matrix size

FOV = 17.45; % cm, FOV of image matrix

Dcm = 7.78; % cm, distance from fan beam vertex to center of stepper motor shaft

D = Dcm*N/FOV; % vertex->center distance in pixels

fanCenterAngle = 80; % fan center angle 

fanAngleWidth = 100; % total width we need in degrees for the fan beam to cover the object

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% subtract off the center fan angle from the servo angles, to center them

%%%%%%%%%%%%%%%%%%%%%%%%%%%

servoAngle = servoAngle – fanCenterAngle;

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% reshape data into a fan beam sinogram matrix. We assume that servo angle

% is minor dim in diodeVoltage vector

%%%%%%%%%%%%%%%%%%%%%%%%%%%

nServoAngles = length(unique(servoAngle));

nStepAngles = length(unique(stepperAngle));

fanBeamData = reshape(diodeVoltage,[nServoAngles,nStepAngles]);

% potVoltage = reshape(potVoltage,[nServoAngles,nStepAngles]);

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% interpolate along the fan beam dimension to center the data

%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

% find increment between servo Angles

deltaServoAngle = abs(diff(unique(servoAngle)));

deltaServoAngle = deltaServoAngle(1);

% find increment between stepper motor angles

deltaStepAngle = abs(diff(unique(stepperAngle)));

deltaStepAngle = deltaStepAngle(1);

 

% get input (I) and output (O) interpolation grids

servoAnglesI = min(servoAngle):deltaServoAngle:max(servoAngle);

stepAngles = min(stepperAngle):deltaStepAngle:max(stepperAngle);

[stepAnglesI,servoAnglesI] = meshgrid(stepAngles,servoAnglesI);

servoAnglesO = -fanAngleWidth/2:fanAngleWidth/2;

[stepAnglesO,servoAnglesO] = meshgrid(stepAngles,servoAnglesO);

 

% do the 2D interpolation to the centered grid that we will use for recon

fanBeamDataCent = interp2(stepAnglesI,servoAnglesI,fanBeamData,stepAnglesO,servoAnglesO,’cubic’,0);

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%

% reconstruct the image

%%%%%%%%%%%%%%%%%%%%%%%%%%%

img = ifanbeam(fliplr(fanBeamDataCent),D,’fancoverage’,’cycle’,’fanrotationincrement’,…

    deltaStepAngle,’fansensorgeometry’,’arc’,’fansensorspacing’,1,…

    ‘filter’,’Ram-Lak’,’frequencyscaling’,1,’interpolation’,’nearest’,…

    ‘outputsize’,N);

figure;imagesc(-img);axis image;colormap gray

 

Question 1:

What happens if you more coarsely or finely sample the stepper motor positions?  The finer the stepper motor position, the higher resolution of the image because there are more data points.