25 Aug 2020

Apply a Recipe on a Batch of Files

Apply a recipe to a batch of files and save the results in an output directory.

This Xtra contains a module that allows you to apply a Recipe to a list of files. For each input file, the recipe results are saved in the specific output directory in the native Amira (.am) format. Result spreadsheets are also exported as .csv files.

Any recipe using a single input can be used. As for any recipe, the provide inputs must be compatible with the recipe input type, or errors will appear in the console. The inputs must be one file per dataset. As a consequence, if you want 2D images to be processed individually, you need to input them individually also, whereas a stack of 2D images stored in a single file will be considered as a 3D volume.

Multichannel datasets also can be selected as input from the 'Input Type' port, but must be available as a single .am file.
Recipes will process one or several specific channels of the multichannel dataset, and can be generated in two different ways:

  • either by using, inside the recipe, the ChannelSelector module, that lets you select one single channel to be processed by the recipe. The module is included in the Xtra archive (in \share\script-objects). See as an example project Batch_MultiChannelRecipe.hx provided with this Xtra.
  • or by processing a recipe that runs on grayscale images and selecting the specific channel(s) using the 'Process Channel' port of the Xtra module BatchApply_RecipePlayer. See as an example project Batch_GrayscaleRecipeOnOneChannel.hx provided with this Xtra.

We advise you to use the Recipe Player and 'Export' mode with the recipes provided in this archive to see how to build recipes that include multichannel data.

Multiple Dicom files also can be processed. In this case, the input must be a root directory where each subdirectory contains all the Dicom files related to a single dataset. Select 'Dicom files' from the 'Input Type' port.