### Install GUROBI Symlinks for Linux and Mac Source: https://www.ilastik.org/documentation/basics/installation Use these commands to create symbolic links for GUROBI on Linux and macOS after installation. Ensure the paths correctly point to your GUROBI installation and ilastik application. ```bash bash install-gurobi-symlinks.sh /your/target/directoy/gurobi1200/linux64 /path/to/ilastik-1.*-Linux ``` ```bash bash install-gurobi-symlinks.sh /your/target/directoy/gurobi1200/macos_universal2/ /path/to/ilastik-1.*-OSX.app ``` -------------------------------- ### Activate GUROBI License on Linux/macOS Source: https://www.ilastik.org/documentation/basics/installation Navigate to the GUROBI binary directory and use this command with your license key to activate the installation. The script prompts for license path confirmation. ```bash # Linux cd /your/target/directory/gurobi1200/linux64/bin # OSX # on OSX gurobi is installed to /Library/ per default. cd /Libary/gurobi1200/macos_universal2/bin # use the obtained license key here ./grbgetkey aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee # Follow the instructions and take note of the license path. ``` -------------------------------- ### Install Xcode Command Line Tools on Mac Source: https://www.ilastik.org/documentation/basics/installation_legacy_cplex For OSX 10.9 Mavericks and later, install the command line tools using this command. This is required if you don't have XCode installed or for older OSX versions. ```bash xcode-select --install ``` -------------------------------- ### Cluster Tracking Script Example Source: https://www.ilastik.org/documentation/animaltracking/animaltracking An example bash script combining segmentation, tracking, and cleanup commands for cluster execution. It includes specifying the number of threads via `LAZYFLOW_THREADS`. ```bash ./run_ilastik.sh --headless --project=.ilp --raw_data= --output_format="compressed hdf5" ./run_ilastik.sh --headless --project=.ilp --raw_data= --segmentation_image=_Simple Segmentation.h5" --export_source="Plugin" --export_plugin="CSV-Table" rm _Simple Segmentation.h5" ``` -------------------------------- ### Activate GUROBI License on Windows Source: https://www.ilastik.org/documentation/basics/installation Use this command in the Windows search bar to activate your GUROBI license after installation. It prompts for the license storage location. ```bash grbgetkey aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee ``` -------------------------------- ### Run ilastik in Headless Mode (Windows) Source: https://www.ilastik.org/documentation/basics/headless Execute ilastik in headless mode on Windows. Ensure you are in the ilastik installation directory and provide the path to your pre-trained project file and the images to process. ```bash $ cd \"Program Files\ilastik-1.4.0\" $ .\ilastik.exe --headless --project=MyProject.ilp my_next_image1.png my_next_image2.png ``` -------------------------------- ### Headless Tracking Workflow with CSV Export Source: https://www.ilastik.org/documentation/basics/headless Example of running the tracking workflow in headless mode, exporting results as a CSV table via a plugin. Ensure the project and data paths are correctly specified. ```bash ./run_ilastik.sh \ --headless \ --project="/path/to/project/MyProject.ilp" \ --raw_data="/path/to/raw/data.h5" \ --prediction_maps="/path/to/boundary/probability/data.h5" \ --export_source="Plugin" \ --export_plugin="CSV-Table" \ ``` -------------------------------- ### Install GUROBI on Linux Source: https://www.ilastik.org/documentation/basics/installation Unpack the GUROBI archive to your desired directory on Linux. This command extracts the files to a specified target location. ```bash tar -xvf gurobi12.0.0_linux64.tar.gz -C /your/target/directory ``` -------------------------------- ### Run ilastik in Headless Mode (Linux) Source: https://www.ilastik.org/documentation/basics/headless Execute ilastik in headless mode on Linux. Ensure you are in the ilastik installation directory and provide the path to your pre-trained project file and the images to process. ```bash $ cd ilastik-1.4.0-Linux/ $ ./run_ilastik.sh --headless --project=MyProject.ilp my_next_image1.png my_next_image2.png ``` -------------------------------- ### Check CPLEX Studio Directory on Windows Source: https://www.ilastik.org/documentation/basics/installation_legacy_cplex Verify that the CPLEX_STUDIO_DIR129 environment variable is correctly set and points to the CPLEX installation directory. This is crucial for ilastik to locate the CPLEX solver. ```bash echo %CPLEX_STUDIO_DIR129% ``` -------------------------------- ### Convert CPLEX Static Libraries to Shared Libraries Source: https://www.ilastik.org/documentation/basics/installation_legacy_cplex Execute the conversion script, providing the paths to your CPLEX installation and ilastik directory. This is necessary for CPLEX to work with ilastik on Linux and Mac. ```bash # navigate to the script location, e.g. /path/to/ilastik-1.*-Linux/ilastik-meta/ilastik/scripts cd /path/to/script # Linux: bash install-cplex-shared-libs.sh /path/to/your/cplex-root-dir /path/to/ilastik-1.*-Linux # Mac: bash install-cplex-shared-libs.sh /path/to/your/cplex-root-dir /path/to/ilastik-1.*-OSX.app ``` -------------------------------- ### Set up GUROBI License and Run ilastik Source: https://www.ilastik.org/documentation/basics/installation Configure the GRB_LICENSE_FILE environment variable if your gurobi.lic is not in the default location. Then, navigate to the ilastik directory and run the application. ```bash export GRB_LICENSE_FILE=/path/to/license/gurobi.lic ``` ```bash cd /path/to/ilastik-1.*-Linux ./run_ilastik.sh ``` -------------------------------- ### Run Ilastik Tracking (Simple Binary) Source: https://www.ilastik.org/documentation/animaltracking/animaltracking This command performs tracking using a simple binary segmentation file. It requires the raw video and the path to the generated segmentation file. The `--export_plugin` argument determines the output format. ```bash ./run_ilastik.sh --headless --project=.ilp --raw_data= --segmentation_image=_Simple Segmentation.h5" --export_source="Plugin" --export_plugin="CSV-Table" ``` -------------------------------- ### Check ilastik Version via Python Script (Mac) Source: https://www.ilastik.org/documentation/basics/headless Execute a Python script using the ilastik-provided interpreter to check the installed ilastik version on macOS. This is useful for verifying installations or within automated workflows. ```bash # Mac $ ./ilastik-1.3.2-OSX.app/Contents/ilastik-release/bin/python -c "import ilastik; print ilastik.__version__" 1.3.2 ``` -------------------------------- ### Download and Prepare GUROBI Linking Script Source: https://www.ilastik.org/documentation/basics/installation Download the script to link GUROBI libraries to ilastik. This is primarily for Linux. Make the script executable before running it. ```bash # set-up environment, only necessary if gurobi.lic is not in the home folder export GRB_LICENSE_FILE=/path/to/license/gurobi.lic # Linux wget https://raw.githubusercontent.com/ilastik/ilastik/main/scripts/install-gurobi-symlinks.sh # Mac curl -O https://raw.githubusercontent.com/ilastik/ilastik/main/scripts/install-gurobi-symlinks.sh # once the download is finished, make the script executable chmod +x install-gurobi-symlinks.sh # link the installed gurobi libraries to the ilastik installation ``` -------------------------------- ### Check ilastik Version via Python Script (Linux) Source: https://www.ilastik.org/documentation/basics/headless Execute a Python script using the ilastik-provided interpreter to check the installed ilastik version on Linux systems. This is useful for verifying installations or within automated workflows. ```bash # Linux $ ./ilastik-1.3.2-Linux/bin/python -c "import ilastik; print ilastik.__version__" 1.3.2 ``` -------------------------------- ### Check for GCC Compiler Source: https://www.ilastik.org/documentation/basics/installation_legacy_cplex Run this command to check if a GCC compiler is installed on your system. This is a prerequisite for converting CPLEX libraries. ```bash gcc --version ``` -------------------------------- ### Run Ilastik Tracking (Probabilities) Source: https://www.ilastik.org/documentation/animaltracking/animaltracking This command runs the tracking using the raw video and the generated foreground/background probabilities. Specify the desired export format using `--export_plugin`. ```bash ./run_ilastik.sh --headless --project=.ilp --raw_data= --prediction_maps=_Probabilities.h5 --export_source="Plugin" --export_plugin="CSV-Table" ``` -------------------------------- ### Set LAZYFLOW_THREADS Environment Variable Source: https://www.ilastik.org/documentation/basics/installation Specify the number of parallel threads ilastik should use by setting the LAZYFLOW_THREADS environment variable when starting from the command line on Linux/OSX. ```bash LAZYFLOW_THREADS=4 run_ilastik.sh [...options] ``` -------------------------------- ### Run ilastik Headless with Custom Output Source: https://www.ilastik.org/documentation/basics/headless This command demonstrates how to run ilastik in headless mode, specifying project file, output format, and a custom filename format for multiple input images. ```bash $ ./run_ilastik.sh --headless \ --project=MyProject.ilp \ --output_format=tiff \ --output_filename_format=/tmp/results/{nickname}_results.tiff \ my_next_image1.png my_next_image2.png ``` -------------------------------- ### Run ilastik in Headless Mode (macOS) Source: https://www.ilastik.org/documentation/basics/headless Execute ilastik in headless mode on macOS. Provide the path to your pre-trained project file and the images to process. ```bash $ ./ilastik-1.4.0-OSX.app/Contents/MacOS/ilastik --headless --project=MyProject.ilp my_next_image1.png my_next_image2.png ``` -------------------------------- ### Run ilastik on Linux Source: https://www.ilastik.org/documentation/basics/installation Navigate to the extracted directory and run the ilastik script on Linux. ```bash cd ilastik-1.* ./run_ilastik.sh ``` -------------------------------- ### Run ilastik with Contours-With-Head Plugin Source: https://www.ilastik.org/documentation/animalTracking/animalTracking This command executes the tracking workflow with the experimental 'Contours-With-Head' plugin. It requires the `_Probabilities.h5` file as input for both raw data and prediction maps, and specifies the custom export plugin. ```bash ./run_ilastik.sh --headless --project=.ilp --raw_data=_Probabilities.h5 --prediction_maps=_Probabilities.h5 --export_source="Plugin" --export_plugin="Contours-With-Head" ``` -------------------------------- ### Configure ilastik Resources with .ilastikrc Source: https://www.ilastik.org/documentation/basics/installation Create or modify the .ilastikrc file in the home directory to set total RAM in MB and the number of threads for ilastik. ```ini [lazyflow] total_ram_mb=4000 threads=4 ``` -------------------------------- ### Run ilastik for Tracking with Head Location Export Source: https://www.ilastik.org/documentation/animaltracking/animaltracking Use this command to run ilastik in headless mode for tracking. Ensure you specify the correct project, raw data, and output format. The `--export_plugin` argument is crucial for exporting head location data. ```bash ./run_ilastik.sh --headless --project=.ilp --raw_data= --output_format="compressed hdf5" ``` ```bash ./run_ilastik.sh --headless --project=.ilp --raw_data=_Probabilities.h5 --prediction_maps=_Probabilities.h5 --export_source="Plugin" --export_plugin="Contours-With-Head" ``` -------------------------------- ### Create and Make Executable Bash Script Source: https://www.ilastik.org/documentation/animaltracking/animaltracking Commands to create a new bash script file and set its execute permissions. This is the first step in preparing a script for cluster execution. ```bash >>>touch .sh >>>chmod u+x .sh ``` -------------------------------- ### Run ilastik in Headless Mode with OME-Zarr Input Source: https://www.ilastik.org/documentation/basics/headless This command demonstrates how to use a specific scale of an OME-Zarr dataset in headless mode. Ensure the provided path points to an individual scale within the multiscale dataset. ```bash $ ./run_ilastik.sh --headless \ --project=MyProject.ilp \ https://s3.embl.de/i2k-2020/platy-raw.ome.zarr/s6 ``` -------------------------------- ### Download CPLEX Shared Library Conversion Script Source: https://www.ilastik.org/documentation/basics/installation_legacy_cplex Use wget to download the script for converting CPLEX static libraries to shared versions if you are using an ilastik version prior to 1.1.7. ```bash wget https://raw.githubusercontent.com/ilastik/ilastik/master/scripts/install-cplex-shared-libs.sh ``` -------------------------------- ### Run Ilastik Segmentation (Probabilities) Source: https://www.ilastik.org/documentation/animaltracking/animaltracking Use this command for the intermediate segmentation step to generate foreground/background probabilities for tracking. Ensure the project file and raw data path are correctly specified. ```bash ./run_ilastik.sh --headless --project=.ilp --raw_data= --output_format="compressed hdf5" ```