I am developing Fiji macro written in Jython and I have a big problem with ThresholdAdjuster class.
In my macro I analyse series of images, and I would like to use ThresholdAdjuster on the first one and apply the chosen value for the rest of the images. That is I would like to choose it manually only on the first image. However I have three problems:
- I have no idea how to read the threshold value from ThresholdAdjuster
- How can I close the theshold window once Apply button is clicked?
- If I change the default threshold (that is if I move the bar) even when i close the threshold window my macro stops working. Is there any command to make in continue working?
This part of code looks like this:
ThresholdAdjuster().run() <----- I would like to read threshold value here, e.g: thresh_val = ThresholdAdjuster.GetValue() imp.setRoi(roi2) <-----This does not execute once threshold is changed! ip = imp.getProcessor() ImageProcessor.erode(ip) ImageProcessor.dilate(ip)
I appreciate any help because I really need to fix this asap.