def calculateDsets(self, dsets, new_fg = True):
        if self.smoothing is True:   
            dsets_new = []
            #smooth only the foreground!
            for index, d in enumerate(dsets):
                if index < len(self.foregrounds) and new_fg is True:
                    data = numpy.ndarray(d.shape, 'float32')
                    for t in range(d.shape[0]):
                        for c in range(d.shape[-1]):
                            if d.shape[1] > 1:
                                start_time = datetime.datetime.now()           
                                dRaw = numpy.asarray(d[t, :, :, :, c])
                                dRaw = dRaw.swapaxes(0, 2).view()
                                res = vigra.filters.gaussianSmoothing(dRaw, self.sigma)
                                res = res.swapaxes(0, 2).view()
                                data[t, :, :, :, c] = res                                          
                            else:
                                dRaw = d[t,0,:,:,c].astype('float32').view(vigra.ScalarImage)           
                                data[t,0,:,:,c] = vigra.filters.gaussianSmoothing(dRaw, self.sigma)
                    dataAcc = DataAccessor(data)
                    dsets_new.append(dataAcc)
                else:
                    dsets_new.append(d)            
            self.dsets = dsets_new
        else:
            self.dsets = dsets
eventually smooth the dataSets before doing the threshold. sad sad world.
dataset/ETHPy150Open ilastik/ilastik-0.5/ilastik/core/overlays/thresholdOverlay.py/ThresholdOverlay.calculateDsets