Skip to content

Instantly share code, notes, and snippets.

@kmader
Last active August 29, 2015 13:57
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 kmader/9659197 to your computer and use it in GitHub Desktop.
Save kmader/9659197 to your computer and use it in GitHub Desktop.
Loads images from ImageJ/FIJI and shows a histogram, plots slices and creates an isosurface
% load the sample image
MIJ.run('Confocal Series (2.2MB)');
stackImage = double(MIJ.getCurrentImage);
% show a slice
imagesc(stackImage(:,:,25));pause(2);
% show a histogram of the image
hist(stackImage(stackImage>0));pause(2);
% create slices
xv=[1,200,400];
yv=xv;
zv=[1,25,50];
slice(stackImage,xv,yv,zv);
set(findobj(gca,'Type','Surface'),'EdgeColor','none')
% create a subregion from the image since these computers are very slow
roiImage=stackImage(100:200,100:200,1:50);
% create isosurface
isosurface(roiImage,100);pause(2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment