Révision 4 bin/image2geometry/measure_sepal.py

measure_sepal.py (revision 4)
2 2

  
3 3
'''
4 4
Usage:
5
measure_sepal.py filename output.csv
5
measure_sepal.py filename outputdir
6 6

  
7 7
- filename = path and name of the stack file containing the object (background=0)
8 8
the object is supposed already oriented as follows:
......
32 32

  
33 33
filename = argv[1]
34 34
outdir = argv[2]
35

  
35 36
outputfile=outdir+"/"+outdir+".csv"
36 37

  
38
outputdir=outdir+"/sections/"
39
projectiondir=outdir+"/projections"
37 40

  
38 41
print(argv)
39 42

  
40 43
imname = filename.split('/')[-1]
41 44
imnameroot = imname.split('.')[0]
42 45

  
43
outputdir = imnameroot+'_sections/'
44
projected2Dimage=outdir+"/"+imnameroot+"2D.png"
45
projected2Dimage_hight=outdir+"/hight_"+imnameroot+"2D.png"
46
projected2Dimage=projectiondir+"/"+imnameroot+"2D.png"
47
#projected2Dimage_hight=outdir+"/hight_"+imnameroot+"2D.png"
46 48

  
47 49
os.system("mkdir -p "+outputdir)
48 50

  
......
122 124
outfile=outroot+'_up_longitudinal.csv'
123 125
graph_name= outputdir+imnameroot+'_up_longitudinal.png'
124 126
length_x, flatlength_x, height_x, R, R21, R22, R41, R423, R44=analyze_curve1(imnameroot, xup, x_pixelsize, outfile, graph_name)
127
os.system("rm "+outfile)
125 128

  
126 129
FILE.write(str(length_x)+';'+str(flatlength_x)+';'+str(height_x)+';'+str(R)+';'+str(R21)+';'+str(R22)+';'+str(R41)+';'+str(R423)+';'+str(R44)+';')
127 130

  
128 131
outfile=outroot+'_up_transversal.csv'
129 132
graph_name= outputdir+imnameroot+'_up_transversal.png'
130 133
length_y, flatlength_y, height_y, R, R21, R22, R41, R423, R44=analyze_curve1(imnameroot, yup, y_pixelsize, outfile, graph_name)
134
os.system("rm "+outfile)
131 135

  
132 136
FILE.write(str(length_y)+';'+str(flatlength_y)+';'+str(height_y)+';'+str(R)+';'+str(R21)+';'+str(R22)+';'+str(R41)+';'+str(R423)+';'+str(R44)+'\n')
133 137

  

Formats disponibles : Unified diff