How to plot an exponential decay profile onto a 2D image?
4 views (last 30 days)
Show older comments
I am trying to create an image of a circular phantom that has signal intensity decaying along the diameter of that phantom. Assume we plot all the pixels in the horizontal direction. This should be an exponential decay. I have this exponential profile and I have the circular phantom. I want a separate phantom image that has this intensity profile at every angle from 0 to 360 degrees in 1 degree increments. Problem: Want an image with a circular phantom (binary image) whose intensity profile is exponentially decaying along the diameter of that phantom. This 1D profile is applied along the diameter at an angle of, say 30 degrees. Imagine using a flashlight on a circular object. I want to simulate (in very simple terms) what the object would look like in the dark. Extend the problem so that the angle at which this profile is applied is variable. What I have: 1) an Image of the circular phantom 2) exponential profile. I'd really appreciate your thoughts / ideas. Thank you in advance and looking forward to hearing to some solutions
0 Comments
Answers (1)
Image Analyst
on 31 Oct 2015
How about this:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 20;
rows = 480;
columns = 640;
[x, y] = meshgrid(1:columns, 1:rows);
% Formula = 255 * exp(-mu*r)
r = sqrt((x-columns/2).^2 + (y-rows/2).^2);
mu = -0.004;
for col = 1 : columns
for row = 1 : rows
grayImage(row, col) = 255 * exp(mu * r(row, col));
end
end
subplot(2,1,1);
imshow(r, []);
axis on;
title('Radius', 'FontSize', fontSize);subplot(2,1,1);
subplot(2,1,2);
imshow(grayImage, []);
axis on;
title('Exponential Decay Image', 'FontSize', fontSize);
0 Comments
See Also
Categories
Find more on Medical Physics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!