Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import fijibin
- import fijibin.macro
- import subprocess
- path_to_imageJ = os.path.join(os.getcwd(), "Application\\Fiji.app\\ImageJ-win64.exe") # Location of ImageJ
- path_to_file = os.path.join(os.getcwd(), "clown1.jpg") # Location of the first image file of my sequence
- x = 100 # Variable distance value
- y = 543 # Variable known value
- macro_single_file = """ run("Open...");
- run("Image Sequence...", "open=[path_to_file] sort");
- run("Set Scale...", "distance=x known=y unit=microns"); """
- subprocess.call([path_to_imageJ]) # This successfully opens the imageJ GUI
- fijibin.macro.run(macro_single_file) # This should ideally run my macro in the loaded GUI above
- # As per the suggested links, I can also run the commands in terminal by using
- # os.system('dir')
- # --or--
- # proc = subprocess.Popen('cmd.exe', stdin = subprocess.PIPE, stdout = subprocess.PIPE)
- # stdout, stderr = proc.communicate(b'dir c:\\')
- # print(stdout)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement