Skip to content

Instantly share code, notes, and snippets.

@hinerm
Created April 19, 2021 18:14
Show Gist options
  • Save hinerm/4693a4e918e452e8d0e16a3edb9b7387 to your computer and use it in GitHub Desktop.
Save hinerm/4693a4e918e452e8d0e16a3edb9b7387 to your computer and use it in GitHub Desktop.
A trivial python script that takes an input image and outputs a "copy", with all values set to the first pixel value.
#@ OpService ops
#@ ImgPlus image
#@OUTPUT ImgPlus copy
#@OUTPUT Integer a
a = 21
copy = ops.copy().img(image.getImg())
c = copy.cursor()
c.fwd()
v = c.get().copy()
while (c.hasNext()) {
c.fwd()
c.get().set(v)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment