def _compute_object_count(self, raw): data = raw.data()[:, :, 0] data = skimage.exposure.equalize_adapthist(data) lm = skimage.feature.peak_local_max(data, threshold_abs=np.percentile( data, 95), min_distance=10) return len(lm)
def _compute_shape(self, raw): x, y = np.mgrid[:raw.data().shape[0], :raw.data().shape[1]] initial = astropy.modeling.models.Gaussian2D(x_stddev=1, y_stddev=1) fitter = astropy.modeling.fitting.LevMarLSQFitter() fit = fitter(initial, x, y, raw.data()[:, :, 0]) return fit.x_stddev / fit.y_stddev
def _compute_percentile_95(self, raw): return np.percentile(raw.data(), 95)
def _compute_mean(self, raw): return raw.data().mean()
def _compute_object_count(self, raw): data = raw.data()[:, :, 0] data = skimage.exposure.equalize_adapthist(data) lm = skimage.feature.peak_local_max(data, threshold_abs=np.percentile(data, 95), min_distance=10) return len(lm)