Based on the other thread and doing a not elegant cut and paste on the python script that @emfro08 posted, I ended up with the following:
import os
import re, glob, os #navigation in diff repertory if script not in the same folder
from os import walk #Find folders and files
from os import listdir
from os.path import isfile, join
import subprocess
ilastik_location = '/opt/ilastik-1.4.0b1-Linux' #location of ilastik
ilastik_project = '/home/user/experiment/multicut_001.ilp' #location of project file
indir = '/home/user/experiment/raw/' #location of raw files
infiles = os.listdir(indir)
probdir = '/home/user/experiment/probabilities/' #location of probability files
probfiles = os.listdir(probdir)
multidir = '/home/user/experiment/multicut/' #where to save results
os.chdir(ilastik_location)
for infile in infiles:
probfile = infile.replace('.tif','_3cNeural_Probabilities.h5') #to match probability file to raw file. In my naming scheme the only difference is the addition of _3cNeural_Probabilities.h5 instead of .tif at the end of file name.
#headless command. Exporting as multipage tiff to fit my downstream application
command = './run_ilastik.sh --headless --project="%s" --raw_data="%s%s" --probabilities="%s%s" --export_source="multicut segmentation" --output_format="multipage tiff" --output_filename_format="%s/{nickname}_multicut.tiff"'% (ilastik_project,indir,infile,probdir,probfile,multidir)
print("\n\n%s" % command)
subprocess.call(command, shell=True)
I did not touch the import portion and just modified the rest so that it would fit a multicut workflow. It does not look very good, but it did the job.