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 = ./
Output Files
The script generates:
merged_localizations.ecsv: Merged localization table in ECSV format. This is the default filename when--output_fileis omitted.[output_folder]/[output_file]: Merged localization table written to the destination selected with--output_folderand--output_file.
Examples
$ cat file_list.txt | localization_merge [options]
$ ls *.ecsv | localization_merge [options]
$ find . -name "*.ecsv" | localization_merge [options]
Merge all .ecsv files in the current directory and save to the default output:
$ ls *.ecsv | localization_mergeMerge specific files and save with a custom name:
$ echo -e "file1.ecsv\nfile2.ecsv\nfile3.ecsv" | localization_merge -o combined.ecsvMerge files and save to a specific directory:
$ find ./data -name "loc_*.ecsv" | localization_merge -O ./results -o merged.ecsvProcess 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