本文整理汇总了Python中ij.ImagePlus.getRoi方法的典型用法代码示例。如果您正苦于以下问题:Python ImagePlus.getRoi方法的具体用法?Python ImagePlus.getRoi怎么用?Python ImagePlus.getRoi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.ImagePlus
的用法示例。
在下文中一共展示了ImagePlus.getRoi方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: siftSingle
# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getRoi [as 别名]
def siftSingle(ref, target):
""" perform SIFT registration for one image """
impRef = ImagePlus('Sift_source', ref)
impTarget = ImagePlus('Sift_target', target)
expected_transformation = 'Similarity'
initial_gaussian_blur = 2
feature_descriptor_size = 8
imp = ImagePlus('siftRefTest', ref)
t = SIFT_ExtractPointRoi()
t.exec( impRef, impTarget )
roiRef = impRef.getRoi()
roiTarget = impTarget.getRoi()
return roiRef, roiTarget
示例2: __falign
# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getRoi [as 别名]
def __falign(self) :
#self.__impRes=IJ.getImage()
stack = self.__impRes.getStack() # get the stack within the ImagePlus
n_slices = stack.getSize() # get the number of slices
ic = ImageCalculator()
w = self.__impRes.getWidth()
h = self.__impRes.getHeight()
self.__sens[:] = []
self.__listrois[:] = []
for index in range(1, n_slices+1):
self.__impRes.setSlice(index)
ip1 = stack.getProcessor(index)
imp1 = ImagePlus("imp1-"+str(index), ip1)
#imp1sqr = ic.run("Multiply create 32-bit", imp1, imp1)
#IJ.setThreshold(imp1sqr, 1, 4294967296)
#IJ.run(imp1sqr, "Create Selection", "")
#IJ.run(imp1sqr, "Select All", "")
#roi = imp1sqr.getRoi()
#rect=roi.getBounds()
#roi = Roi(rect)
#self.__listrois.append(roi)
#ipsqr = imp1sqr.getProcessor()
#is1 = ipsqr.getStatistics()
#self.__impRes.killRoi()
IJ.run(imp1, "Select All", "")
roi = imp1.getRoi()
self.__listrois.append(roi)
ipsqr = imp1.getProcessor()
is1 = ipsqr.getStatistics()
self.__impRes.killRoi()
if is1.xCenterOfMass > w/2.00 :
self.__impRes.setRoi(roi)
ip1 = self.__impRes.getProcessor()
ip1.flipHorizontal()
self.__impRes.killRoi()
self.__sens.append(-1)
else : self.__sens.append(1)
self.__impRes.updateAndDraw()