本文整理汇总了Python中ij.measure.ResultsTable.getRowAsString方法的典型用法代码示例。如果您正苦于以下问题:Python ResultsTable.getRowAsString方法的具体用法?Python ResultsTable.getRowAsString怎么用?Python ResultsTable.getRowAsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.measure.ResultsTable
的用法示例。
在下文中一共展示了ResultsTable.getRowAsString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __localwand
# 需要导入模块: from ij.measure import ResultsTable [as 别名]
# 或者: from ij.measure.ResultsTable import getRowAsString [as 别名]
def __localwand(self, x, y, ip, seuil, method, light):
self.__image.killRoi()
ip.snapshot()
if method == "mean" :
peak=ip.getPixel(x,y)
tol = (peak - self.getMean())*seuil
w = Wand(ip)
w.autoOutline(x, y, tol, Wand.EIGHT_CONNECTED)
#print "method=", method, tol, peak
elif method == "background" :
radius = self.getMinF()/4
bs = BackgroundSubtracter()
#rollingBallBackground(ImageProcessor ip, double radius, boolean createBackground, boolean lightBackground, boolean useParaboloid, boolean doPresmooth, boolean correctCorners)
bs.rollingBallBackground(ip, radius, False, light, False, True, False)
peak=ip.getPixel(x,y)
tol = peak*seuil
w = Wand(ip)
w.autoOutline(x, y, tol, Wand.EIGHT_CONNECTED)
ip.reset()
#print "method=", method, tol, radius, peak
else :
peak=ip.getPixel(x,y)
tol = peak*seuil
w = Wand(ip)
w.autoOutline(x, y, tol, Wand.EIGHT_CONNECTED)
#print "method=", method, tol
peak=ip.getPixel(x,y)
temproi=PolygonRoi(w.xpoints, w.ypoints, w.npoints, PolygonRoi.POLYGON)
self.__image.setRoi(temproi)
#self.__image.show()
#time.sleep(1)
#peakip=self.__image.getProcessor()
#stats=peakip.getStatistics()
temprt = ResultsTable()
analyser = Analyzer(self.__image, Analyzer.AREA+Analyzer.INTEGRATED_DENSITY+Analyzer.FERET, temprt)
analyser.measure()
#temprt.show("temprt")
rtValues=temprt.getRowAsString(0).split("\t")
area=float(rtValues[1])
intDen=float(rtValues[4])
feret=float(rtValues[2])
mean=intDen/area
#time.sleep(2)
temprt.reset()
self.__image.killRoi()
return [peak, area, mean, intDen, feret]
示例2: Morph
# 需要导入模块: from ij.measure import ResultsTable [as 别名]
# 或者: from ij.measure.ResultsTable import getRowAsString [as 别名]
class Morph(object):
"""
Fourni les mesures principales pour l'analyse des cellules bacteriennes:
proprietes:
1-MaxFeret
2-MinFeret
3-AngleFeret
4-XFeret
5-YFeret
6-Area
7-Mean
8-StdDev
9-IntDen
10-Kurt
11-Skew
12-Angle
13-Major
14-Minor
15-Solidity
16-AR
17-Round
18-Circ.
19-XM
20-YM
21-X
22-Y
23-FerCoord: tuple contenant x1, y1, x2, y2 du MaxFeret
24-Fprofil: list contenant les valeurs du profil le long de MaxFeret
25-FerAxis: Line ROI
26-MidAxis: Polyline ROI de l'axe median par skeletonize
27-MidProfil: list contenant les valeurs du profil le long de MidAxis
28-nb Foci
29-ListFoci: liste des positions des foci par cellule
30-ListAreaFoci: liste des area des foci
31-ListPeaksFoci: liste des int max des foci
32-ListMeanFoci liste des int mean des foci
toute les proprietes mettent a jour l'image cible par: object.propriete=imp
Methodes:
getFeretSegments(n segments)
getMidSegments(n segments, radius, tool 0= ligne perpendiculaire, 1= cercle, 2= ligne tangente)
selectInitRoi: active la ROI initiale
Statics:
distMorph(liste de coordonees a mesurer= (coefficient, valeur initiale, valeur finale))
setteurs:
setImage(ImagePlus)
setImageMeasures(imagePlus) met a jours les mesures avec imagePlus
setImageMidprofil(imagePlus) met a jours le profil avec imagePlus
setLineWidth(width) afecte la largeur de ligne pour le profil pour Fprofile et MidProfil defaut = 0
setshowFprof(True) affiche le graphique de profil Fprofil defaut = False
setMidParams(longueur mesurer l'angle de l'extremite en pixels defaut=10, coefficient pour prolonger et trouver l'intersection avec le contour defaut=1.3
"""
def __Measures(self):
self.__boolmeasures=True
if (self.__contour is not None) and (self.__contour.getType() not in [9,10]):
self.__image.killRoi()
self.__image.setRoi(self.__contour)
self.__ip=self.__image.getProcessor()
self.__rt= ResultsTable()
analyser= Analyzer(self.__image, Analyzer.AREA+Analyzer.CENTER_OF_MASS+Analyzer.CENTROID+Analyzer.ELLIPSE+Analyzer.FERET+Analyzer.INTEGRATED_DENSITY+Analyzer.MEAN+Analyzer.KURTOSIS+Analyzer.SKEWNESS+Analyzer.MEDIAN+Analyzer.MIN_MAX+Analyzer.MODE+Analyzer.RECT+Analyzer.SHAPE_DESCRIPTORS+Analyzer.SLICE+Analyzer.STACK_POSITION+Analyzer.STD_DEV, self.__rt)
analyser.measure()
#self.__rt.show("myRT")
else:
self.__rt = ResultsTable()
analyser = Analyzer(self.__image, Analyzer.AREA+Analyzer.CENTER_OF_MASS+Analyzer.CENTROID+Analyzer.ELLIPSE+Analyzer.FERET+Analyzer.INTEGRATED_DENSITY+Analyzer.MEAN+Analyzer.KURTOSIS+Analyzer.SKEWNESS+Analyzer.MEDIAN+Analyzer.MIN_MAX+Analyzer.MODE+Analyzer.RECT+Analyzer.SHAPE_DESCRIPTORS+Analyzer.SLICE+Analyzer.STACK_POSITION+Analyzer.STD_DEV, self.__rt)
analyser.measure()
#self.__rt.show("myRT")
maxValues=self.__rt.getRowAsString(0).split("\t")
heads=self.__rt.getColumnHeadings().split("\t")
for val in heads: self.__rt.setValue(val, 0, Float.NaN)
#self.__rt.show("myRT")
# calculate the 1/2 , 1/4 ... 1/n positions for a liste while 1/n >= 1 returns a dict = 0: (0, [0, 0, pos(1/2)]) 1: (1, [-1, -0.5, -pos(1/4)], [0, 0, pos(1/2)], [1, 0.5, pos(1/2)])
def __Centers(self, line) :
L=len(line)
l2=L//2
l=L
pos={}
for i in range(self.log2(L)) :
l = l//2
pos[i]=l
l=L
dicPos={}
jtot=1
for i in range(self.log2(L)) :
s=[]
j=1
while (l2-j*pos[i])>0 or (l2+j*pos[i])<L :
s.append((-j,(l2-j*pos[i])))
s.append((j,(l2+j*pos[i])))
j=j+1
s.append((0,l2))
s.sort()
if ((len(s)+1)*pos[i]-L)//pos[i] > 0 :
#.........这里部分代码省略.........