本文整理汇总了Python中ij.ImagePlus.getStatistics方法的典型用法代码示例。如果您正苦于以下问题:Python ImagePlus.getStatistics方法的具体用法?Python ImagePlus.getStatistics怎么用?Python ImagePlus.getStatistics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.ImagePlus
的用法示例。
在下文中一共展示了ImagePlus.getStatistics方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getStatistics [as 别名]
# time_series_measure.py
# this script makes ROI measurements of each slice of a movie
# the results are listed in on continuing table/text file
# Dan White and Silke Gerwig MPI-CBG
# Aug 2009
# Dan White 2016
#!/usr/bin/env python
from ij import IJ, ImagePlus
# the current image
imp = IJ.getImage()
stack = imp.getStack()
roi = imp.getRoi()
# for all the frames in the movie, run measure
for i in range(1, imp.getNFrames() + 1): # remember a python range (1, 10) is the numbers 1 to 9!
#getNFrames not getNSlices since input data is a 2D time series stack NOT a 3D stack.
frame = ImagePlus(str(i), stack.getProcessor(i))
# Execute get statistics exactly on this slice i, with the ROI in use
frame.setRoi(roi)
stats = frame.getStatistics()
IJ.log(" area: "+ str(stats.area) + " mean: "+ str(stats.mean))
IJ.log("Done!")