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.
- PYMEcs/Acquire/Actions/__init__.py +0 -0
- PYMEcs/Acquire/Actions/custom.py +167 -0
- PYMEcs/Acquire/Hardware/LPthreadedSimple.py +248 -0
- PYMEcs/Acquire/Hardware/LPthreadedSimpleSim.py +246 -0
- PYMEcs/Acquire/Hardware/NikonTiFlaskServer.py +45 -0
- PYMEcs/Acquire/Hardware/NikonTiFlaskServerT.py +59 -0
- PYMEcs/Acquire/Hardware/NikonTiRESTClient.py +73 -0
- PYMEcs/Acquire/Hardware/NikonTiSim.py +35 -0
- PYMEcs/Acquire/Hardware/__init__.py +0 -0
- PYMEcs/Acquire/Hardware/driftTrackGUI.py +329 -0
- PYMEcs/Acquire/Hardware/driftTrackGUI_n.py +472 -0
- PYMEcs/Acquire/Hardware/driftTracking.py +424 -0
- PYMEcs/Acquire/Hardware/driftTracking_n.py +433 -0
- PYMEcs/Acquire/Hardware/fakeCamX.py +15 -0
- PYMEcs/Acquire/Hardware/offsetPiezoRESTCorrelLog.py +38 -0
- PYMEcs/Acquire/__init__.py +0 -0
- PYMEcs/Analysis/MBMcollection.py +552 -0
- PYMEcs/Analysis/MINFLUX.py +280 -0
- PYMEcs/Analysis/MapUtils.py +77 -0
- PYMEcs/Analysis/NPC.py +1176 -0
- PYMEcs/Analysis/Paraflux.py +218 -0
- PYMEcs/Analysis/Simpler.py +81 -0
- PYMEcs/Analysis/Sofi.py +140 -0
- PYMEcs/Analysis/__init__.py +0 -0
- PYMEcs/Analysis/decSofi.py +211 -0
- PYMEcs/Analysis/eventProperties.py +50 -0
- PYMEcs/Analysis/fitDarkTimes.py +569 -0
- PYMEcs/Analysis/objectVolumes.py +20 -0
- PYMEcs/Analysis/offlineTracker.py +130 -0
- PYMEcs/Analysis/stackTracker.py +180 -0
- PYMEcs/Analysis/timeSeries.py +63 -0
- PYMEcs/Analysis/trackFiducials.py +186 -0
- PYMEcs/Analysis/zerocross.py +91 -0
- PYMEcs/IO/MINFLUX.py +851 -0
- PYMEcs/IO/NPC.py +117 -0
- PYMEcs/IO/__init__.py +0 -0
- PYMEcs/IO/darkTimes.py +19 -0
- PYMEcs/IO/picasso.py +219 -0
- PYMEcs/IO/tabular.py +11 -0
- PYMEcs/__init__.py +0 -0
- PYMEcs/experimental/CalcZfactor.py +51 -0
- PYMEcs/experimental/FRC.py +338 -0
- PYMEcs/experimental/ImageJROItools.py +49 -0
- PYMEcs/experimental/MINFLUX.py +1537 -0
- PYMEcs/experimental/NPCcalcLM.py +560 -0
- PYMEcs/experimental/Simpler.py +369 -0
- PYMEcs/experimental/Sofi.py +78 -0
- PYMEcs/experimental/__init__.py +0 -0
- PYMEcs/experimental/binEventProperty.py +187 -0
- PYMEcs/experimental/chaining.py +23 -0
- PYMEcs/experimental/clusterTrack.py +179 -0
- PYMEcs/experimental/combine_maps.py +104 -0
- PYMEcs/experimental/eventProcessing.py +93 -0
- PYMEcs/experimental/fiducials.py +323 -0
- PYMEcs/experimental/fiducialsNew.py +402 -0
- PYMEcs/experimental/mapTools.py +271 -0
- PYMEcs/experimental/meas2DplotDh5view.py +107 -0
- PYMEcs/experimental/mortensen.py +131 -0
- PYMEcs/experimental/ncsDenoise.py +158 -0
- PYMEcs/experimental/onTimes.py +295 -0
- PYMEcs/experimental/procPoints.py +77 -0
- PYMEcs/experimental/pyme2caml.py +73 -0
- PYMEcs/experimental/qPAINT.py +965 -0
- PYMEcs/experimental/randMap.py +188 -0
- PYMEcs/experimental/regExtraCmaps.py +11 -0
- PYMEcs/experimental/selectROIfilterTable.py +72 -0
- PYMEcs/experimental/showErrs.py +51 -0
- PYMEcs/experimental/showErrsDh5view.py +58 -0
- PYMEcs/experimental/showShiftMap.py +56 -0
- PYMEcs/experimental/snrEvents.py +188 -0
- PYMEcs/experimental/specLabeling.py +51 -0
- PYMEcs/experimental/splitRender.py +246 -0
- PYMEcs/experimental/testChannelByName.py +36 -0
- PYMEcs/experimental/timedSpecies.py +28 -0
- PYMEcs/experimental/utils.py +31 -0
- PYMEcs/misc/ExtraCmaps.py +177 -0
- PYMEcs/misc/__init__.py +0 -0
- PYMEcs/misc/configUtils.py +169 -0
- PYMEcs/misc/guiMsgBoxes.py +27 -0
- PYMEcs/misc/mapUtils.py +230 -0
- PYMEcs/misc/matplotlib.py +136 -0
- PYMEcs/misc/rectsFromSVG.py +182 -0
- PYMEcs/misc/shellutils.py +1110 -0
- PYMEcs/misc/utils.py +205 -0
- PYMEcs/misc/versionCheck.py +20 -0
- PYMEcs/misc/zcInfo.py +90 -0
- PYMEcs/pyme_warnings.py +4 -0
- PYMEcs/recipes/__init__.py +0 -0
- PYMEcs/recipes/base.py +75 -0
- PYMEcs/recipes/localisations.py +2380 -0
- PYMEcs/recipes/manipulate_yaml.py +83 -0
- PYMEcs/recipes/output.py +177 -0
- PYMEcs/recipes/processing.py +247 -0
- PYMEcs/recipes/simpler.py +290 -0
- PYMEcs/version.py +2 -0
- pyme_extra-1.0.4.post0.dist-info/METADATA +114 -0
- pyme_extra-1.0.4.post0.dist-info/RECORD +101 -0
- pyme_extra-1.0.4.post0.dist-info/WHEEL +5 -0
- pyme_extra-1.0.4.post0.dist-info/entry_points.txt +3 -0
- pyme_extra-1.0.4.post0.dist-info/licenses/LICENSE +674 -0
- 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)
|