I’m using ImageJ to create masks of fluorescence images (.czi files) in the following way:
gaussian blur > thresholding > noise-remove outliers
I want to implement this process in python for automaticity and having trouble with the thresholding step. In ImageJ, MinError autothresholding gives great threshold values (when dark background is checked). my data is 2048x2048 and uint16.
I tried to use skimage.filters.threshold_minimum(image=None, nbins=256, max_num_iter=10000,hist=None)
, when the input is my image (after Gaussian blur as follows skimage.filters.gaussian(data,sigma=sigma,preserve_range=True)
) and 256 bins I get high number that is way far from the desired threshold.
When the input is a histogram that I calculated using np.histogram(image.flatten(), bins=256)
then I get a realistic threshold but its still different than the value I got from ImageJ for the same steps.
Does anyone have experience with this problem and can advise?