Skip to content

Instantly share code, notes, and snippets.

@drhirsch
Created September 2, 2016 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drhirsch/880ed308bffe78646bfe2b93c62543aa to your computer and use it in GitHub Desktop.
Save drhirsch/880ed308bffe78646bfe2b93c62543aa to your computer and use it in GitHub Desktop.
makes 2-D pyramid phantom
do:
N = 256;
MinVal = 0;
MaxVal = 2^16 -1;
data = nan(N);
temp = uint16(MinVal:round((MaxVal-MinVal)/(N/2)):MaxVal);
for i = 1:N/2
data(i,i:end-i+1) = temp(i);
data(i:end-i+1,i) = temp(i);
data(end-i+1,i:end-i+1) = temp(i);
data(i:end-i+1,end-i+1) = temp(i);
end
figure, mesh(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment