Hi everyone,
After giving up with Knime (Read ilastik ouput on knime), I managed to run Ilastik headless mode with Python (How to call and run ilastik from python?) thanks to @CellKai 's kind reply.
However, it appears that it takes much more time to process my datasets (each dataset contains about 100 images). With “normal” mode, it takes 1 minute per dataset, but with this script (see below), each dataset takes 10 minutes to be processed… and I have thousands of datasets per experiment.
import os
from os import listdir
import subprocess
ilastik_location = 'path/to/ilastik'
ilastik_project = 'path/to/project.ilp'
for dataset in range(first_set, last_set):
indir='path/to/dataset/'
infiles = os.listdir(indir)
os.chdir(ilastik_location)
for infile in infiles:
if infile[-4:] != '.tif':
print ("skipping %s" % infile)
continue
command = 'run-ilastik.bat --headless --project="%s" --output_filename_format="%s/{nickname}_results.h5"--export_source="Probabilities" --raw_data="%s%s"' % (
ilastik_project,
indir,
indir,
infile)
print ("\n\n%s" % command)
subprocess.call(command, shell=True)
Please, could you let me know if you have any clue about the way to increase speed of processing ?
Kindly yours !