Closed fkim1223 closed 7 years ago
That's a good catch!
Hi Thank you for checking and making the change. I had tried modifying the code myself, and I think the line 259 may also have to be changed to something like np.choose(fptp < contrast_threshold,(f >= fmean, f >= gthresh)). After that, I'm getting a very similar result to that of imagej. I think the difference may be related to the way structural element is defined in both programs. I'll have to compare this later. I'm new to python, and it took me awhile to understand numpy choose command. Please check if my proposed modification makes sense. Would this program process 16 bit image as well?
Yes, 16 bits should not be a problem.
There may indeed be a difference in whether the comparison to the threshold is performed as a >
or a >=
. I would actually like to compare with the original publication, but I cannot seem to get it.
Hi, I recently discovered this python program to try bernsen's thresholding method. I liked the option to change gthresh value. I gave it a try and I was getting a different result from bernsen's method implemented in imagej though. After looking at the code, it appears that there may be an error on line 258: fmean = fmax/.2 + fmin/.2. I think the values should be divided by 2 not 0.2. Is it possible to check and recompile the code if it is an error? Thank you.