I wrote a macro in python to apply contrast enhancement with different percentages .
For this purpose I have made a GenericDialog Box with different checkboxes. If a checkbox is TRUE, the macro opens a stack with images and applies contrast enhancement. Hence, I save the path of each stack in a list called “Output”.
So far so good.
Now I want to use this code to open the images as a stack:
IJ.run("Image Sequence...", "open=["Output"] sort")
But this does not work, because of a SyntaxError.
I tried a test with the whole path in the code and it works.
IJ.run("Image Sequence...", "open=[/Users/mate/Desktop/preparation/contastenhancement/stack1/.DS_Store] sort")
This code also doesn’t work because it can’t open the whole images as a stack. That’s why I prefer the code before.
imp = IJ.openImage(os.path.join(Output))
What is the correct syntax?
I can’t believe I’m failing here.
Thank you for any advice!