本文整理匯總了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)