exampleFilename = fileNameFormat[threshes["Organelle"]] % threshes
        currentImage = Image.open(imageDataPath + exampleFilename)
        asArray = fromimage(currentImage).reshape((numImagePoints, 3))

        # port to thresholdNDArray
        if applyExpertThresholds:
            expertThresholds = dict(((c, threshes[c]) for c in colorNames))
            thresholdNDArray(asArray, expertThresholds)

        # asArray = fromimage(currentImage).reshape((numImagePoints, 3))
        stackArray = np.concatenate((stackArray, asArray))

    org = simplifyOrgStain(threshes["Organelle"], threshes["Stain"])
    # r = threshes["Series"] - 1
    t = timeToIdx(threshes["Time"])

    print org, t

    # convert image stack to counts and add to histograms
    for c1, c2 in colorPairs:
        probs = toProbs(stackArray[:, c1],
                        stackArray[:, c2],
                        removeNonresponders=removeNonresponders,
                        removeSaturated=removeSaturated,
                        useLogscaleCounts=useLogscaleCounts)
        cnd = (org, c1, c2, t)
        storedProbs[cnd] = probs

outputFile = open(outputFile, "wb")
cPickle.dump(storedProbs, outputFile, -1)
                qDict = {"R8D": qs[R][0], "R9D": qs[R][1],
                         "G8D": qs[G][0], "G9D": qs[G][1],
                         "B8D": qs[B][0], "B9D": qs[B][1]}

                predThreshes = dict((c, applyCurrentLM(qDict, 
                                                       c)) for c in colorNames)
                # print ",".join("%5.4f" % t for t in predThresholds.values())
                thresholdNDArray(pixels, predThreshes, dropSaturated=True)

            expArray = np.concatenate((expArray, pixels))
#########################################
# all to here is necessary to get joined series
#########################################

    org = simplifyOrgStain(cnd["Organelle"], cnd["Stain"])
    t = timeToIdx(cnd["Time"])

    print org, t

    # convert image stack to counts and add to histograms
    for c1, c2 in colorPairs:
        probs = toProbs(expArray[:,c1], expArray[:,c2],
                        removeNonresponders = removeNonresponders,
                        removeSaturated     = removeSaturated,
                        useLogscaleCounts   = useLogscaleCounts)
        cnd = (org, c1, c2, t)
        storedProbs[cnd] = probs
    
outputFile = open(outputFile, "wb")
cPickle.dump(storedProbs, outputFile, -1)
outputFile.close()