Skip to content

Instantly share code, notes, and snippets.

@miura
Created June 3, 2015 15:26
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 miura/d396b62be3815881a90e to your computer and use it in GitHub Desktop.
Save miura/d396b62be3815881a90e to your computer and use it in GitHub Desktop.
cc=0;
for(k=0; k<nSlices; k++)
for(j=0;j<getHeight();j++)
for(i=0;i<getWidth();i++)
{setSlice(k+1);if(getPixel(i,j)>0)cc++;}
print("non-0:" + cc);
@miura
Copy link
Author

miura commented Jun 3, 2015

count non-0 pixels in a stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment