本文整理汇总了Python中ij.plugin.frame.RoiManager.close方法的典型用法代码示例。如果您正苦于以下问题:Python RoiManager.close方法的具体用法?Python RoiManager.close怎么用?Python RoiManager.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.plugin.frame.RoiManager
的用法示例。
在下文中一共展示了RoiManager.close方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MandersColocalization
# 需要导入模块: from ij.plugin.frame import RoiManager [as 别名]
# 或者: from ij.plugin.frame.RoiManager import close [as 别名]
manders = MandersColocalization()
results = ResultsTable()
for imageFile in os.listdir(inputDir):
print "Opening " + imageFile
try:
images = BF.openImagePlus(inputDir + imageFile)
image = images[0]
except UnknownFormatException:
continue
preview = getPreview(image)
preview.show()
rm = RoiManager()
dialog = WaitForUserDialog("Action required", "Please select regions of interest in this image. Click OK when done.")
dialog.show()
rm.close()
splitter = ChannelSplitter()
imp1 = ImagePlus("CH1", splitter.getChannel(image, imageA))
imp2 = ImagePlus("CH2", splitter.getChannel(image, imageB))
title = image.getTitle()
title = title[:title.rfind('.')]
image.close()
preview.close()
ch1 = ImagePlusAdapter.wrap(imp1)
ch2 = ImagePlusAdapter.wrap(imp2)
for roi in rm.getRoisAsArray():
container = createContainer(roi, ch1, ch2)
img1 = container.getSourceImage1()
img2 = container.getSourceImage2()
mask = container.getMask()
示例2: RoiManager
# 需要导入模块: from ij.plugin.frame import RoiManager [as 别名]
# 或者: from ij.plugin.frame.RoiManager import close [as 别名]
if reffn is None:
print "User canceled the dialog!"
else:
refdir = odref.getDirectory()
refpath = os.path.join(refdir, reffn)
refImp = IJ.openImage(refpath)
width = refImp.width
height = refImp.height
roim = RoiManager()
roim.runCommand("open", roipath)
roiArray = roim.getRoisAsArray()
nRoi = len(roiArray)
roim.close()
bwStack = ImageStack(width, height, nRoi)
for i in xrange(1, nRoi+1):
bwStack.setProcessor(FloatProcessor(width, height, zeros('f', width * height), None), i)
for i in xrange(1, nRoi+1):
roi = roiArray[i-1]
fp = bwStack.getProcessor(i)
fp.setValue(1.0)
fp.fill(roi)
roiImp = ImagePlus("roi", bwStack)
outfn = "roi_" + os.path.splitext(roifn)[0] + ".tif"
outpath = os.path.join(roidir, outfn)