BIOE190/290 Spring 2020
Homework 1
Due February 6, 2020
For the following problems please submit your code and solutions to the problems.
1. Calculating SNR/CNR Import the image set ‘brain.mat’ into MATLAB (or Python). If using matlab you can use the imagesc function to view the image slice. It is suggested that you use a gray colormap. Use the roipoly function to calculate SNR over the entire brain. Similarly, calculate the CNR between white and gray matter on this image set.
𝑆𝑁𝑅 = 𝑚𝑒𝑎𝑛 𝑠𝑖𝑔𝑛𝑎𝑙 𝑜𝑓 𝑅𝑂𝐼
𝑠𝑡𝑑 𝑑𝑒𝑣 𝑜𝑓 𝑙𝑎𝑟𝑔𝑒𝑠𝑡 𝑝𝑜𝑠𝑠𝑖𝑏𝑙𝑒 𝑏𝑎𝑐𝑘𝑔𝑟𝑜𝑢𝑛𝑑 𝑠𝑖𝑔𝑛𝑎𝑙
𝐶𝑁𝑅 = 𝑚𝑒𝑎𝑛 𝑠𝑖𝑔𝑛𝑎𝑙< − 𝑚𝑒𝑎𝑛 𝑠𝑖𝑔𝑛𝑎𝑙>
𝑠𝑡𝑑 𝑑𝑒𝑣 𝑜𝑓 𝑙𝑎𝑟𝑔𝑒𝑠𝑡 𝑝𝑜𝑠𝑠𝑖𝑏𝑙𝑒 𝑏𝑎𝑐𝑘𝑔𝑟𝑜𝑢𝑛𝑑 𝑠𝑖𝑔𝑛𝑎𝑙
2. Impact of Noise Use the randn function to add gaussian noise to the entire image, where the peak noise is 10% of the mean signal intensity of white matter from part 1. Recalculate SNR and CNR (using the same ROI’s as before). How does the addition of noise affect SNR/CNR? (which one is more affected, and why?)
3. Improvement of SNR via Averaging Repeat the above step to generate a second image with a different noise distribution. Average the two images with added gaussian noise, and then recalculate SNR and CNR. Do the same for 4 images with added gaussian noise. How does the number of images averaged together affect SNR/CNR? (which one is more affected, and why?)
4. Impact of Spatial Resolution Use the medfilt2 function to down-sample the image by creating a 2×2 blurring kernel, and then recalculate SNR and CNR. How does lowering the resolution affect SNR/CNR? (which one is more affected, and why?)
5. Lies, damn lies, and statistics You will find as you work through your reading assignment this semester that many studies compare imaging results between a treatment and control group of mice (typically less than 10 per group) using a simple student’s t- test. Similarly, you may find that some imaging studies report a single “intensity” value that is derived from a mixture of tissues. Often, these studies have a small sample size, and reported differences between treatment groups may actually be due simply to random selection bias from within a larger normal distribution of patients. We can model this rather simply via the following.
Use the randn function to create an array of values (range 0-10) of size 1,000 that follows a Gaussian distribution. We can treat this distribution as the imaging measurement
BIOE190/290 Spring 2020
derived from everyone in a single population. Next create two experimental groups (pretend that one receives a drug and one a placebo and the ‘intensity’ measurement claims to tell you about the subsequent density of diseased tissue). Starting with n = 1 person per group, assign each person a value randomly chosen from your array of possible imaging derived values (your Gaussian distribution). Within a group, no two people can have the same index within that array. Between groups, the array indexes can, and eventually will duplicate. For group sizes of 1 to 1,000, run a student’s t-test to see if the distributions are significantly different. For each group size that generates statistical significance print out the number of people required to achieve significance, and plot the distributions of values for both groups on the same graph, which should show two completely different distributions between group A and B. What you will likely notice is that you fail to reach statistical significance (p < 0.05) for small group sizes. At some point you will reach statistical significance, but depending on your random sampling of one large distribution you may reach, then lose, then reach statistical significance several times. Eventually, your two groups should begin to completely overlap, since you are in fact sampling the same underlying population.
What does this exercise reveal about the potential pitfalls of sampling bias and statistical design?
When you think about the relevance to molecular imaging, what does it tell you about the required magnitude of contrast for a molecular imaging probe to allow meaningful discrimination between tissues where it is present and background tissue signals?