当前位置: 首页>>代码示例>>Python>>正文


Python RoiManager.close方法代码示例

本文整理汇总了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()
开发者ID:rejsmont,项目名称:FijiScripts,代码行数:32,代码来源:mcoloc.py

示例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)
开发者ID:singingstars,项目名称:lab-program,代码行数:33,代码来源:roi.to.mask_.py


注:本文中的ij.plugin.frame.RoiManager.close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。