Ilastik headless batch processing. Can't load a stack of plane tiffs as a list

Hi @k-dominik

I am playing around with batch processing in headless mode of ilastik 1.3.3. I made it work both from the command line and from python subprocess module with:

./run_ilastik.sh --headless \
                --output_format=hdf5 \
                --output_filename_format=/das/work/p18/p18491/Data10/disk1/Ilastik_MP/{nickname}_test3103.h5 \
                --project=/sls/X02DA/Data20/e15889/Maxim_LCT/lung_imaging/new_Mar21/test_data/pixel.ilp \
                --export_source='simple segmentation' \
                --input_axes=zyx \
                --stack_along=z \
                "/sls/X02DA/Data20/e15889/Maxim_LCT/lung_imaging/new_Mar21/test_data/data1/*.tif"

And

## in python also worked
test_string = '/Users/mpolikarpov/Desktop/desktop_shared/ilastik/test_data/data2/*'
subprocess.run(["/Applications/ilastik-1.3.3post3-OSX.app/Contents/ilastik-release/run_ilastik.sh",
                '--headless',
                '--output_format=hdf5',
                '--output_filename_format=/Users/mpolikarpov/Desktop/desktop_shared/ilastik/test_data/{nickname}_planetif_new2.h5',
                '--project=/Users/mpolikarpov/Desktop/desktop_shared/ilastik/test_data/proj_133/pixel.ilp',
                '--export_source=simple segmentation',
                '--raw_data='+test_string])

Now, I would like to combine different plane tiffs into one stack as described here but none of my attempts worked.

I tried on both Linux and Macos: different separators (incl. :) and combinations of how to pass the command options and the list.

One of my command-line examples:

# didn't work
./run_ilastik.sh --headless \
                --output_format=hdf5 \
                --output_filename_format=/das/work/p18/p18491/Data10/disk1/Ilastik_MP/{nickname}_test3103.h5 \
                --project=/sls/X02DA/Data20/e15889/Maxim_LCT/lung_imaging/new_Mar21/test_data/pixel.ilp \
                --export_source='simple segmentation' \
                --input_axes=zyx \
                --stack_along=z \
                "/sls/X02DA/Data20/e15889/Maxim_LCT/lung_imaging/new_Mar21/test_data/data2/M277_CF03l_stitched_cropped_02180.tif" "/sls/X02DA/Data20/e15889/Maxim_LCT/lung_imaging/new_Mar21/test_data/data2/M277_CF03l_stitched_cropped_02181.tif" "/sls/X02DA/Data20/e15889/Maxim_LCT/lung_imaging/new_Mar21/test_data/data2/M277_CF03l_stitched_cropped_02182.tif" "/sls/X02DA/Data20/e15889/Maxim_LCT/lung_imaging/new_Mar21/test_data/data2/M277_CF03l_stitched_cropped_02183.tif"

It always throws me the error

ilastik.applets.dataSelection.opDataSelection.UnsuitedAxistagsException: Axistags ['z', 'y', 'x'] don't fit data shape (4168, 3664)

and I take it as an indication that only the first 2180 is being read. Removing "" doesn’t help

Do you have an advice of what could I try?

I was really trying to find a workaround but none of my combinations worked.

Hello @mpolikarpov,

I vaguely remember a similar question somewhere that I always wanted to follow up on but didn’t. Sorry if it was you :wink:

In any case, great that you added so much detail here, it was easy enough to try this out and find a solution…

  • try the latest beta version of ilastiik and use the linux path separator (same on mac) : to separate your files in a single quoted string… So something like "file1.tif:file2.tif:file3.tif"…
  • if you’re stuck with version 1.3.3 for some reason, you could consider (and I can of course see how this might be very inconvenient) copying all the files for a specific stack to a separate folder and passing in the stack as "file*.tif".

Hope that it wasn’t too frustrating so far…

1 Like

it was :smile:
But thanks for the update! I will try new version :slight_smile:

1 Like