PYME-extra 1.0.4.post0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. PYMEcs/Acquire/Actions/__init__.py +0 -0
  2. PYMEcs/Acquire/Actions/custom.py +167 -0
  3. PYMEcs/Acquire/Hardware/LPthreadedSimple.py +248 -0
  4. PYMEcs/Acquire/Hardware/LPthreadedSimpleSim.py +246 -0
  5. PYMEcs/Acquire/Hardware/NikonTiFlaskServer.py +45 -0
  6. PYMEcs/Acquire/Hardware/NikonTiFlaskServerT.py +59 -0
  7. PYMEcs/Acquire/Hardware/NikonTiRESTClient.py +73 -0
  8. PYMEcs/Acquire/Hardware/NikonTiSim.py +35 -0
  9. PYMEcs/Acquire/Hardware/__init__.py +0 -0
  10. PYMEcs/Acquire/Hardware/driftTrackGUI.py +329 -0
  11. PYMEcs/Acquire/Hardware/driftTrackGUI_n.py +472 -0
  12. PYMEcs/Acquire/Hardware/driftTracking.py +424 -0
  13. PYMEcs/Acquire/Hardware/driftTracking_n.py +433 -0
  14. PYMEcs/Acquire/Hardware/fakeCamX.py +15 -0
  15. PYMEcs/Acquire/Hardware/offsetPiezoRESTCorrelLog.py +38 -0
  16. PYMEcs/Acquire/__init__.py +0 -0
  17. PYMEcs/Analysis/MBMcollection.py +552 -0
  18. PYMEcs/Analysis/MINFLUX.py +280 -0
  19. PYMEcs/Analysis/MapUtils.py +77 -0
  20. PYMEcs/Analysis/NPC.py +1176 -0
  21. PYMEcs/Analysis/Paraflux.py +218 -0
  22. PYMEcs/Analysis/Simpler.py +81 -0
  23. PYMEcs/Analysis/Sofi.py +140 -0
  24. PYMEcs/Analysis/__init__.py +0 -0
  25. PYMEcs/Analysis/decSofi.py +211 -0
  26. PYMEcs/Analysis/eventProperties.py +50 -0
  27. PYMEcs/Analysis/fitDarkTimes.py +569 -0
  28. PYMEcs/Analysis/objectVolumes.py +20 -0
  29. PYMEcs/Analysis/offlineTracker.py +130 -0
  30. PYMEcs/Analysis/stackTracker.py +180 -0
  31. PYMEcs/Analysis/timeSeries.py +63 -0
  32. PYMEcs/Analysis/trackFiducials.py +186 -0
  33. PYMEcs/Analysis/zerocross.py +91 -0
  34. PYMEcs/IO/MINFLUX.py +851 -0
  35. PYMEcs/IO/NPC.py +117 -0
  36. PYMEcs/IO/__init__.py +0 -0
  37. PYMEcs/IO/darkTimes.py +19 -0
  38. PYMEcs/IO/picasso.py +219 -0
  39. PYMEcs/IO/tabular.py +11 -0
  40. PYMEcs/__init__.py +0 -0
  41. PYMEcs/experimental/CalcZfactor.py +51 -0
  42. PYMEcs/experimental/FRC.py +338 -0
  43. PYMEcs/experimental/ImageJROItools.py +49 -0
  44. PYMEcs/experimental/MINFLUX.py +1537 -0
  45. PYMEcs/experimental/NPCcalcLM.py +560 -0
  46. PYMEcs/experimental/Simpler.py +369 -0
  47. PYMEcs/experimental/Sofi.py +78 -0
  48. PYMEcs/experimental/__init__.py +0 -0
  49. PYMEcs/experimental/binEventProperty.py +187 -0
  50. PYMEcs/experimental/chaining.py +23 -0
  51. PYMEcs/experimental/clusterTrack.py +179 -0
  52. PYMEcs/experimental/combine_maps.py +104 -0
  53. PYMEcs/experimental/eventProcessing.py +93 -0
  54. PYMEcs/experimental/fiducials.py +323 -0
  55. PYMEcs/experimental/fiducialsNew.py +402 -0
  56. PYMEcs/experimental/mapTools.py +271 -0
  57. PYMEcs/experimental/meas2DplotDh5view.py +107 -0
  58. PYMEcs/experimental/mortensen.py +131 -0
  59. PYMEcs/experimental/ncsDenoise.py +158 -0
  60. PYMEcs/experimental/onTimes.py +295 -0
  61. PYMEcs/experimental/procPoints.py +77 -0
  62. PYMEcs/experimental/pyme2caml.py +73 -0
  63. PYMEcs/experimental/qPAINT.py +965 -0
  64. PYMEcs/experimental/randMap.py +188 -0
  65. PYMEcs/experimental/regExtraCmaps.py +11 -0
  66. PYMEcs/experimental/selectROIfilterTable.py +72 -0
  67. PYMEcs/experimental/showErrs.py +51 -0
  68. PYMEcs/experimental/showErrsDh5view.py +58 -0
  69. PYMEcs/experimental/showShiftMap.py +56 -0
  70. PYMEcs/experimental/snrEvents.py +188 -0
  71. PYMEcs/experimental/specLabeling.py +51 -0
  72. PYMEcs/experimental/splitRender.py +246 -0
  73. PYMEcs/experimental/testChannelByName.py +36 -0
  74. PYMEcs/experimental/timedSpecies.py +28 -0
  75. PYMEcs/experimental/utils.py +31 -0
  76. PYMEcs/misc/ExtraCmaps.py +177 -0
  77. PYMEcs/misc/__init__.py +0 -0
  78. PYMEcs/misc/configUtils.py +169 -0
  79. PYMEcs/misc/guiMsgBoxes.py +27 -0
  80. PYMEcs/misc/mapUtils.py +230 -0
  81. PYMEcs/misc/matplotlib.py +136 -0
  82. PYMEcs/misc/rectsFromSVG.py +182 -0
  83. PYMEcs/misc/shellutils.py +1110 -0
  84. PYMEcs/misc/utils.py +205 -0
  85. PYMEcs/misc/versionCheck.py +20 -0
  86. PYMEcs/misc/zcInfo.py +90 -0
  87. PYMEcs/pyme_warnings.py +4 -0
  88. PYMEcs/recipes/__init__.py +0 -0
  89. PYMEcs/recipes/base.py +75 -0
  90. PYMEcs/recipes/localisations.py +2380 -0
  91. PYMEcs/recipes/manipulate_yaml.py +83 -0
  92. PYMEcs/recipes/output.py +177 -0
  93. PYMEcs/recipes/processing.py +247 -0
  94. PYMEcs/recipes/simpler.py +290 -0
  95. PYMEcs/version.py +2 -0
  96. pyme_extra-1.0.4.post0.dist-info/METADATA +114 -0
  97. pyme_extra-1.0.4.post0.dist-info/RECORD +101 -0
  98. pyme_extra-1.0.4.post0.dist-info/WHEEL +5 -0
  99. pyme_extra-1.0.4.post0.dist-info/entry_points.txt +3 -0
  100. pyme_extra-1.0.4.post0.dist-info/licenses/LICENSE +674 -0
  101. pyme_extra-1.0.4.post0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,77 @@
1
+ from PYME.IO.MetaDataHandler import NestedClassMDHandler
2
+ from PYME.IO.image import ImageStack
3
+ from PYME.DSView import ViewIm3D
4
+ import numpy as np
5
+ import wx
6
+ from PYMEcs.misc.guiMsgBoxes import Warn
7
+ from scipy.ndimage import gaussian_filter
8
+
9
+ from traits.api import HasTraits, Str, Int, CStr, List, Enum, Float
10
+ #from traitsui.api import View, Item, Group
11
+ #from traitsui.menu import OKButton, CancelButton, OKCancelButtons
12
+
13
+ class procPtsChoice(HasTraits):
14
+ minimal_distance_in_nm = Float(30)
15
+ sigma_for_Gaussian_blur = Float(2)
16
+
17
+
18
+ class procPts:
19
+ """
20
+ GUI class to process point positions produced by blobfind
21
+ """
22
+ def __init__(self, dsviewer):
23
+ self.dsviewer = dsviewer
24
+ self.procPtsSel = procPtsChoice()
25
+
26
+ dsviewer.AddMenuItem('Experimental>Object Processing',
27
+ 'Set all pixels of detected object centers in new image',
28
+ self.OnProcPoints)
29
+
30
+ def OnProcPoints(self, event=None):
31
+ try:
32
+ points = self.dsviewer.view.points
33
+ except AttributeError:
34
+ Warn(None, 'no object locations found')
35
+ return
36
+
37
+ if len(self.dsviewer.view.points) < 1:
38
+ Warn(None, 'object location list empty')
39
+ return
40
+
41
+ if not self.procPtsSel.configure_traits(kind='modal'):
42
+ return
43
+
44
+ xp = np.rint(self.dsviewer.view.points[:,0])
45
+ yp = np.rint(self.dsviewer.view.points[:,1])
46
+
47
+ mindistnm = self.procPtsSel.minimal_distance_in_nm # make this an option
48
+ mindistpix = mindistnm / (1e3*self.dsviewer.image.mdh.voxelsize.x)
49
+ # here we need some code to remove points with NND < mindist
50
+ xd = np.subtract.outer(xp,xp)
51
+ yd = np.subtract.outer(yp,yp)
52
+ d = np.sqrt(xd**2+yd**2)
53
+ np.fill_diagonal(d,1e6)
54
+ dmin = d.min(0)
55
+ xp2 = xp[dmin >= mindistpix]
56
+ yp2 = yp[dmin >= mindistpix]
57
+
58
+ imd = np.zeros(self.dsviewer.image.data.shape[0:2])
59
+ imd[xp2.astype('i'),yp2.astype('i')] = 1
60
+ sigma = self.procPtsSel.sigma_for_Gaussian_blur # in future may make this a config parameter
61
+ imf = gaussian_filter(imd,sigma)
62
+
63
+ im = ImageStack(imf, titleStub = 'object positions')
64
+ mdh2 = NestedClassMDHandler(self.dsviewer.image.mdh)
65
+ im.mdh.copyEntriesFrom(mdh2)
66
+
67
+ if self.dsviewer.mode == 'visGUI':
68
+ mode = 'visGUI'
69
+ else:
70
+ mode = 'lite'
71
+
72
+ dv = ViewIm3D(im, mode=mode, glCanvas=self.dsviewer.glCanvas,
73
+ parent=wx.GetTopLevelParent(self.dsviewer))
74
+
75
+
76
+ def Plug(dsviewer):
77
+ procPts(dsviewer)
@@ -0,0 +1,73 @@
1
+ import wx
2
+ import numpy as np
3
+
4
+ def pipelineSaveCSV(pipeline,filename,keys):
5
+ pipeline.save_txt(filename,keys)
6
+
7
+
8
+ def p_fileinfo(pipeline,keys):
9
+ xlim = [float(pipeline['x'].min()),float(pipeline['x'].max())]
10
+ ylim = [float(pipeline['y'].min()),float(pipeline['y'].max())]
11
+ fileinfo = dict(xCol = keys.index('x'),
12
+ yCol= keys.index('y'),
13
+ ChanIDCol= None,
14
+ ClusMembershipIDCol = None,
15
+ LabelIDCol = None,
16
+ UIDCol = None)
17
+ fileinfo.update(dict(InputFileDelimiter=',',InputFileExt='.csv'))
18
+ fileinfo.update(dict(AutoAxes=False,
19
+ AutoAxesNearest=1000,
20
+ ImageSize=[xlim[1]-xlim[0],ylim[1]-ylim[0],0],
21
+ DataScale=1,
22
+ xMin=xlim[0],
23
+ xMax=xlim[1],
24
+ yMin=ylim[0],
25
+ yMax=ylim[1]))
26
+ fileinfo.update(dict(ClosestFriend=1,
27
+ FurthestFriend=100))
28
+ return fileinfo
29
+
30
+
31
+ def pipelineSaveJSON(pipeline,filename,keys):
32
+ import json
33
+ fileinfo = p_fileinfo(pipeline,keys)
34
+
35
+ with open(filename,"w+") as file:
36
+ json.dump(fileinfo, file,skipkeys=True,indent=3)
37
+
38
+
39
+ class IOcaml:
40
+ """
41
+
42
+ """
43
+ def __init__(self, visFr):
44
+ self.visFr = visFr
45
+ self.pipeline = visFr.pipeline
46
+
47
+ visFr.AddMenuItem('Experimental>Deprecated>IO', "Save event data to CSV and JSON for CAML",self.OnSaveCaml)
48
+
49
+ def OnSaveCaml(self,event):
50
+ import os
51
+ pipeline = self.pipeline
52
+ keys = ['x','y','t','A','error_x','error_y']
53
+ if 'sig' in pipeline.keys():
54
+ keys.append('sig')
55
+ if 'dbscanClumpID' in pipeline.keys():
56
+ keys.append('dbscanClumpID')
57
+ if 'nPhotons' in pipeline.keys():
58
+ keys.append('nPhotons')
59
+ if 'nchi2' in pipeline.keys():
60
+ keys.append('nchi2')
61
+
62
+ filename = wx.FileSelector('Save events for CAML (select basename)...',
63
+ wildcard="CSV files (*.csv)|*.csv",
64
+ flags = wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
65
+
66
+ if not filename == '':
67
+ base, ext = os.path.splitext(filename)
68
+ pipelineSaveCSV(pipeline,base+".csv",keys)
69
+ pipelineSaveJSON(pipeline,base+".json",keys)
70
+
71
+ def Plug(visFr):
72
+ """Plugs this module into the gui"""
73
+ visFr.iocaml = IOcaml(visFr)