How can I remove the empty space in the output file of "Simple Segmentation"?

Hello, everyone,
I’m using the “Tracking with Binary mask” workflow to track the objects in my images.
Here is what I’ve done:

  • I got my workflow trained and saved.
  • I have the segmentations of each of my raw data image (*_Simple Segmentation.h5)

Now I want to track all my objects with the headless model.
There is one issue here. The normal command line would be :

run_ilastik.sh --headless --project XXX \
--raw_data img1.h5 img2.h5 \
--segmentation_image mask1.h5 mask2.h5

But now the masks given by pixel classification with option “Simple Segmentation” have an empty space inside the file name…

And that makes for example the mask1_Simple Segmentation.h5 two files in the headless mode.
the mask1_Simple, and the Segmentation.h5.
Of course it won’t find anything like those.

Won’t it be more “programmer-friendly” to just add an “_” inbetween ?
What do you think ? Is there any specific reason you want to keep the empty space?
@ilastik_team @k-dominik

1 Like

I agree. This has been annoying me for some while :smiley:

no!

So assuming you are generating your segmentations in ilastik, you can also remove the {result_type} magic string in the file name (in the data export applet) and replace it with a meaningful name like segmentation_image.

Same goes for headless mode (assuming you’re doing pixel classification in headless) you can add --output_filename_format=/out_folder/{nickname}_simple_segmentation.h5

Wow, thank you for your super fast reply. :open_mouth:
The -output_filename_format will do.

Just another quick question. Where can I find the docs of the magic strings you refer to? How many of them are available ? Since I do want to sort it in my way.
I didn’t find it on your website. Sorry, if it’s just me who ignored it. :expressionless:

https://www.ilastik.org/documentation/basics/headless#output-options is the place to look at.

you can find the strings described under the --output_filename_format bullet point. Of course the docs are missing the {result_type}

1 Like

Thanks! Obviously, I saw it and forgot it…