コード例 #1
0
def getPSFSlice(datasource, resultsSource, metadata, zm=None):
    f1 = inpFilt.resultsFilter(resultsSource,
                               error_x=[1, 30],
                               A=[10, 500],
                               sig=(150 / 2.35, 900 / 2.35))

    ims, pts, zvals, zis = extractIms(datasource, f1, metadata, zm)
    return getPSF(ims, pts, zvals, zis)
コード例 #2
0
ファイル: h5rNoGui.py プロジェクト: RuralCat/CLipPYME
    def RegenFilter(self):
        if not self.selectedDataSource == None:
            self.filter = inpFilt.resultsFilter(self.selectedDataSource, **self.filterKeys)
            if self.mapping:
                self.mapping.resultsSource = self.filter
            else:
                self.mapping = inpFilt.mappingFilter(self.filter)

            if not self.colourFilter:
                self.colourFilter = inpFilt.colourFilter(self.mapping, self)

        self.edb = None
        self.objects = None

        self.GeneratedMeasures = {}
コード例 #3
0
    def RegenFilter(self):
        if not self.selectedDataSource == None:
            self.filter = inpFilt.resultsFilter(self.selectedDataSource,
                                                **self.filterKeys)
            if self.mapping:
                self.mapping.resultsSource = self.filter
            else:
                self.mapping = inpFilt.mappingFilter(self.filter)

            if not self.colourFilter:
                self.colourFilter = inpFilt.colourFilter(self.mapping, self)

        self.edb = None
        self.objects = None

        self.GeneratedMeasures = {}
コード例 #4
0
ファイル: h5r-thumbnailer.py プロジェクト: RuralCat/CLipPYME
def generateThumbnail(inputFile, thumbSize):
    f1 = inpFilt.h5rSource(inputFile)

    threeD = False
    stack = False
    split = False

    # print f1.keys()

    if "fitResults_Ag" in f1.keys():
        # if we used the splitter set up a mapping so we can filter on total amplitude and ratio
        f1_ = inpFilt.mappingFilter(
            f1, A="fitResults_Ag + fitResults_Ar", gFrac="fitResults_Ag/(fitResults_Ag + fitResults_Ar)"
        )
        # f2 = inpFilt.resultsFilter(f1_, error_x=[0,30], A=[5, 1e5], sig=[100/2.35, 350/2.35])
        split = True
    else:
        f1_ = f1

    if "fitResults_sigma" in f1.keys():
        f2 = inpFilt.resultsFilter(f1_, error_x=[0, 30], A=[5, 1e5], sig=[100 / 2.35, 350 / 2.35])
    else:
        f2 = inpFilt.resultsFilter(f1_, error_x=[0, 30], A=[5, 1e5])

    if "fitResults_z0" in f1_.keys():
        threeD = True

    if "Events" in dir(f1.h5f.root):
        events = f1.h5f.root.Events[:]

        evKeyNames = set()
        for e in events:
            evKeyNames.add(e["EventName"])

        if "ProtocolFocus" in evKeyNames:
            stack = True

    xmax = f2["x"].max()
    ymax = f2["y"].max()

    if xmax > ymax:
        step = xmax / thumbSize
    else:
        step = ymax / thumbSize

    im, edx, edy = histogram2d(f2["x"], f2["y"], [arange(0, xmax, step), arange(0, ymax, step)])

    f1.close()

    im = minimum(2 * (255 * im) / im.max(), 255).T

    im = concatenate((im[:, :, newaxis], im[:, :, newaxis], im[:, :, newaxis]), 2)

    if stack:
        im[-10:, -10:, 0] = 180

    if threeD:
        im[-10:, -10:, 1] = 180

    if split:
        im[-10:-5, :10, 1] = 210
        im[-5:, :10, 0] = 210

    return im.astype("uint8")
コード例 #5
0
def generateThumbnail(inputFile, thumbSize):
    f1 = inpFilt.h5rSource(inputFile)

    threeD = False
    stack = False
    split = False

    #print f1.keys()

    if 'fitResults_Ag' in f1.keys():
        #if we used the splitter set up a mapping so we can filter on total amplitude and ratio
        f1_ = inpFilt.mappingFilter(
            f1,
            A='fitResults_Ag + fitResults_Ar',
            gFrac='fitResults_Ag/(fitResults_Ag + fitResults_Ar)')
        #f2 = inpFilt.resultsFilter(f1_, error_x=[0,30], A=[5, 1e5], sig=[100/2.35, 350/2.35])
        split = True
    else:
        f1_ = f1

    if 'fitResults_sigma' in f1.keys():
        f2 = inpFilt.resultsFilter(f1_,
                                   error_x=[0, 30],
                                   A=[5, 1e5],
                                   sig=[100 / 2.35, 350 / 2.35])
    else:
        f2 = inpFilt.resultsFilter(f1_, error_x=[0, 30], A=[5, 1e5])

    if 'fitResults_z0' in f1_.keys():
        threeD = True

    if 'Events' in dir(f1.h5f.root):
        events = f1.h5f.root.Events[:]

        evKeyNames = set()
        for e in events:
            evKeyNames.add(e['EventName'])

        if 'ProtocolFocus' in evKeyNames:
            stack = True

    xmax = f2['x'].max()
    ymax = f2['y'].max()

    if xmax > ymax:
        step = xmax / thumbSize
    else:
        step = ymax / thumbSize

    im, edx, edy = histogram2d(
        f2['x'], f2['y'],
        [arange(0, xmax, step), arange(0, ymax, step)])

    f1.close()

    im = minimum(2 * (255 * im) / im.max(), 255).T

    im = concatenate((im[:, :, newaxis], im[:, :, newaxis], im[:, :, newaxis]),
                     2)

    if stack:
        im[-10:, -10:, 0] = 180

    if threeD:
        im[-10:, -10:, 1] = 180

    if split:
        im[-10:-5, :10, 1] = 210
        im[-5:, :10, 0] = 210

    return im.astype('uint8')
コード例 #6
0
ファイル: extractImages.py プロジェクト: RuralCat/CLipPYME
def getPSFSlice(datasource, resultsSource, metadata, zm=None):
    f1 = inpFilt.resultsFilter(resultsSource, error_x=[1,30], A=[10, 500], sig=(150/2.35, 900/2.35))

    ims, pts, zvals, zis = extractIms(datasource, f1, metadata, zm)
    return getPSF(ims, pts, zvals, zis)