localization_merge

Reliability status: development

A utility script for merging multiple localization files into a single consolidated output. This script is designed to work with localization tables containing spatial coordinates and related metadata for microscopy or imaging analysis.

The script takes localization files as input via stdin (e.g., through piping or redirection) and merges them into a single output file. It preserves all data from the original files while combining them into one comprehensive table.

usage: localization_merge [-h] [-o OUTPUT_FILE] [-O OUTPUT_FOLDER]

Named Arguments

-o, --output_file

Output File name. Default = merged_localizations.ecsv

-O, --output_folder

Output folder name. Default = ./

Usage example

$ cat file_list.txt | localization_merge [options]
$ ls *.ecsv | localization_merge [options]
$ find . -name "*.ecsv" | localization_merge [options]
  1. Merge all .ecsv files in the current directory and save to the default output:

    $ ls *.ecsv | localization_merge

  2. Merge specific files and save with a custom name:

    $ echo -e "file1.ecsv\nfile2.ecsv\nfile3.ecsv" | localization_merge -o combined.ecsv

  3. Merge files and save to a specific directory:

    $ find ./data -name "loc_*.ecsv" | localization_merge -O ./results -o merged.ecsv

  4. Process files listed in a text file:

    $ cat files_to_merge.txt | localization_merge

Notes

  • The script requires the LocalizationTable class from the imageProcessing module

  • Input files must be in a format readable by the LocalizationTable.load() method

  • Output is saved in ECSV (Enhanced Character Separated Values) format

  • The script reports the number of localizations in each file and the final merged file