Skip to content

Commit

Permalink
Version for testing web server
Browse files Browse the repository at this point in the history
  • Loading branch information
darogan committed Dec 11, 2017
1 parent 8fa5097 commit 514a0df
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ParticleStats/ParticleStats_Inputs.py
Expand Up @@ -199,7 +199,7 @@ def DrawTrailsOnImageFile(FileName,ParticleNo,CoordsSet,Colour,Coords,Scale,
i = 0
while i < len(Coords):
draw.point( (Coords[i][4]/Scale, Coords[i][5]/Scale),fill=Colour )
if(i > minprint and i <= maxprint and ParticleNo == 1 and i % 100 == 0):
if(i > minprint and i <= maxprint and ParticleNo == 5 and i % 100 == 0):
print ',' . join([ str(Coords[i][1]), str(Coords[i][2]), str(Coords[i][4]), str(Coords[i][5]) ])
i += 1

Expand Down
43 changes: 36 additions & 7 deletions ParticleStats/TrackAlign_Functions.py
Expand Up @@ -703,7 +703,7 @@ def GenerateRandomCoords (Coords,Frames,Type,ntrails,imagesize,NoiseAmount,\

#------------------------------------------------------------------------------
def PlotMatchingTrails (OutName,IMSize,ImageName,Query,Hits,HitList,Colours,\
Polygon,PolygonColour):
Polygon,PolygonColour):

OutName = OutName+"_Hits"
scene = Scene(OutName,IMSize[0],IMSize[1])
Expand All @@ -727,22 +727,51 @@ def PlotMatchingTrails (OutName,IMSize,ImageName,Query,Hits,HitList,Colours,\
print "SUB:", i, HitList[i], Hits[HitList[i]][0][4], Hits[HitList[i]][0][5], Hits[HitList[i]][-1][4], Hits[HitList[i]][-1][5]
i += 1


i = 0
while i < len(Hits):
print "sub:", i, Hits[i][0][4], Hits[i][0][5], Hits[i][-1][4], Hits[i][-1][5]
i += 1

# Print the reference trail in black, with green/red circles at ends

scene.add(Circle((Query[0][4],Query[0][5]),1,0,0,(0,255,0),0.5))
scene.add(Line((Query[0][4],Query[0][5]), (Query[-1][4], Query[-1][5]),(255,0,0),1,0.5))
scene.add(Circle((Query[-1][4], Query[-1][5]),1,0,0,(255,0,0),0.5))

# i = 0
# while i < len(Results[0][0]):
# if i == 0:
# scene.add(Circle((Results[0][0][i][0],Results[0][0][i][1]),\
# 1,0,0,(0,255,0),0.5))
# #if i == (len(Results[0][0])-1):
# # scene.add(Circle((Results[0][0][i][0],Results[0][0][i][1]),\
# # 1,0,0,(255,0,0),0.5))
# scene.add(Circle((Results[0][0][i][0],Results[0][0][i][1]),1,0,0,(0,255,0),0.5))
#if i == (len(Results[0][0])-1):
# scene.add(Circle((Results[0][0][i][0],Results[0][0][i][1]),\
# 1,0,0,(255,0,0),0.5))
# if i > 0:
# scene.add(Line((Results[0][0][i-1][0],Results[0][0][i-1][1]),\
# (Results[0][0][i][0],Results[0][0][i][1]),\
# (255,0,0),1,0.5))
# i += 1

# Print the matching trails
i = 1
while i < len(HitList):
RGB = ColourConvert(Colours[i])

j = 0
while j < len(Hits[HitList[i]]):

if j == 0:
scene.add(Circle((Hits[HitList[i]][j][4], Hits[HitList[i]][j][5]),0.5,0,0,(0,255,0),0.5))
if j == (len(Hits[HitList[i]])-1):
scene.add(Circle((Hits[HitList[i]][j][4], Hits[HitList[i]][j][5]),0.5,0,0,(255,0,0),0.5))
if j > 0:
scene.add(Line((Hits[HitList[i]][j-1][4],Hits[HitList[i]][j-1][5]),\
(Hits[HitList[i]][j][4], Hits[HitList[i]][j][5]),\
(RGB[0],RGB[1],RGB[2]),0.5,0.5))
j += 1

i += 1

# i = 1
# while i < len(Results):
# RGB = ColourConvert(Colours[i])
Expand All @@ -756,7 +785,7 @@ def PlotMatchingTrails (OutName,IMSize,ImageName,Query,Hits,HitList,Colours,\
# # 0.5,0,0,(255,0,0),0.5))
# if j > 0:
# scene.add(Line((Results[i][0][j-1][0],Results[i][0][j-1][1]),\
# (Results[i][0][j][0],Results[i][0][j][1]),\
# (Results[i][0][j][0],Results[i][0][j][1]),\
# (RGB[0],RGB[1],RGB[2]),0.5,0.5))
# j += 1
#
Expand Down
2 changes: 0 additions & 2 deletions scripts/TrackAlign.py
Expand Up @@ -467,8 +467,6 @@
print PS_Inputs.Colourer(Separator,"grey",options.OutputType,"",FontSize_Text)


sys.exit()

if options.Polygon:

cnt_ROI_R = 0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -48,7 +48,7 @@
license = 'GPLv3',
packages = ['ParticleStats'],
#py_modules=[ "ParticleStats_Inputs.py", "ParticleStats_Maths.py", "ParticleStats_Outputs.py", "ParticleStats_Plots.py", "ParticleStats_RandomTrailGenerator.py", "ParticleStats_Vectors.py", "Test_Interactive_OSX_DivideUpLines.py", "Test_Interactive_OSX.py", "Test_Interactive.py" ],
scripts=["scripts/ParticleStats_Compare.py", "scripts/ParticleStats_Directionality.py", "scripts/ParticleStats_Kymographs.py", "scripts/ParticleStats_ROI.py", "scripts/ParticleStats_Trackmate.py", "scripts/ParticleStats_Vibtest.py", "scripts/TrackAlign.py"],
scripts=["scripts/ParticleStats_Compare.py", "scripts/ParticleStats_Directionality.py", "scripts/ParticleStats_Kymographs.py", "scripts/ParticleStats_ROI.py", "scripts/ParticleStats_Trackmate.py", "scripts/ParticleStats_Vibtest.py", "scripts/TrackAlign.py", "scripts/ParticleStats_Behavioral.py"],
ext_modules = [module1],
package_data={
'ParticleStats': [
Expand Down

0 comments on commit 514a0df

Please sign in to comment.