Skip to content, Skip to search

Changes

ImageJ2 Python Scripts

400 bytes added, 07:13, 16 November 2016
Apply a mask
targetCursor.get().set(dataRA.get())
ij.ui().show("output", output)
</source>
 
As specified by @stelfrich on Gitter, the particular case when forground pixel are 1 and background pixels are 1 can be simpler to write with a multiplication of the two images.
 
<source lang='python'>
# @ImageJ ij
# @Dataset data
# @Dataset mask
output = ij.dataset().create(data)
ij.op().op("math.multiply", output, data.getImgPlus(), mask.getImgPlus())
ij.ui().show("output", output)
</source>
123
edits