本文整理汇总了Python中ij.plugin.frame.RoiManager.getSliceNumber方法的典型用法代码示例。如果您正苦于以下问题:Python RoiManager.getSliceNumber方法的具体用法?Python RoiManager.getSliceNumber怎么用?Python RoiManager.getSliceNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.plugin.frame.RoiManager
的用法示例。
在下文中一共展示了RoiManager.getSliceNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: StackCells
# 需要导入模块: from ij.plugin.frame import RoiManager [as 别名]
# 或者: from ij.plugin.frame.RoiManager import getSliceNumber [as 别名]
#.........这里部分代码省略.........
self.__isD = self.__impD.getImageStack()
self.__display.text = "DIA="+self.__impD.getTitle()
self.__initDIA = True
def __fluo(self, event):
IJ.run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel")
self.__impF = IJ.getImage()
self.__isF = self.__impF.getImageStack()
self.__display.text = "FLUO="+self.__impF.getTitle()
self.__initFLUO = True
def __addroi(self, event) :
if ( not self.__init) :
IJ.showMessage("", "please start a new stack")
return
if ( not self.__initDIA) :
IJ.showMessage("", "please select an image for DIA")
return
if ( not self.__initFLUO) :
IJ.showMessage("", "please select an image for FLUO")
return
twres = TextWindow("measures-"+self.__name, "label\tname\tsol\tarea\tcirc\tAR\tFeret\taxis\traf\tdMajor\tdFeret\tdArea", "", 300, 450)
tab="\t"
self.__widthl = self.__display2.getText()
IJ.selectWindow(self.__impF.getTitle())
self.__rm = RoiManager.getInstance()
if (self.__rm==None): self.__rm = RoiManager()
if self.__impF.getImageStackSize() > 1 :
roisarray =[(roi, self.__rm.getSliceNumber(roi.getName())) for roi in self.__rm.getRoisAsArray()]
else :
roisarray =[(roi, 1) for roi in self.__rm.getRoisAsArray()]
self.__rm.runCommand("reset")
#self.__rm.runCommand("Delete")
IJ.selectWindow(self.__impF.getTitle())
self.__maxraf=float(self.__display19.text)
self.__minraf=float(self.__display20.text)
count=1
for roielement in roisarray :
roi = roielement[0]
pos = roielement[1]
lab = self.__impF.getImageStack().getShortSliceLabel(pos)
if lab==None : lab=str(pos)
if self.__conEllipses :
IJ.selectWindow(self.__impF.getTitle())
self.__impF.setSlice(pos)
self.__impF.setRoi(roi)
self.__rm.runCommand("Add")
IJ.run(self.__impF, "Fit Ellipse", "")
ellipse=self.__impF.getRoi()
params = ellipse.getParams()
ferets = ellipse.getFeretValues()
imp2 = Duplicator().run(self.__impF,pos,pos)
IJ.run(imp2, "Rotate... ", "angle="+str(ferets[1])+" grid=0 interpolation=Bilinear enlarge slice")
temproi=Roi((imp2.getWidth()-ferets[0])/2.0,(imp2.getHeight()-ferets[2])/2.0,ferets[0],ferets[2])
imp2.setRoi(temproi)