fishtank.scripts.decode_spots

Contents

fishtank.scripts.decode_spots#

fishtank.scripts.decode_spots(input, strategy=None, output='decoded_spots', file_pattern='spots_{fov}.csv', fovs=None, color_usage='{input}/color_usage.csv', max_dist=1.7, min_snr=4, normalize_colors=True, filter_output=True, save_intensities=False, positions=None, flip_horizontal=False, flip_vertical=False, img_size=2304, **kwargs)#

Decode spots using specified strategy.

fishtank decode-spots -i input -s strategy -o output

Parameters:
  • input (str | Path) – Input file path or directory.

  • strategy (Union[str, Path, None] (default: None)) – Decoding strategy file.

  • output (str | Path (default: 'decoded_spots')) – Output file path.

  • file_pattern (str (default: 'spots_{fov}.csv')) – Naming pattern for files if input is a directory.

  • fovs (Union[list[int], slice, None] (default: None)) – Set of fields of view to process.

  • color_usage (str (default: '{input}/color_usage.csv')) – Path to color usage file.

  • max_dist (float (default: 1.7)) – Maximum distance between intensity and codebook vectors.

  • min_snr (float (default: 4)) – Minimum signal-to-noise for bits in the codebook.

  • normalize_colors (bool (default: True)) – Normalize intensities by color.

  • filter_output (bool (default: True)) – Exclude spots with distance > max_dist from output.

  • save_intensities (bool (default: False)) – Include spot intensities in output.

  • positions (Union[str, Path, None] (default: None)) – Path to a two-column (no header) TSV file with x and y positions for each FOV. Row index corresponds to FOV number. When provided, overrides global_x/global_y columns.

  • flip_horizontal (bool (default: False)) – Flip spot x-coordinates (maps x → img_size - x).

  • flip_vertical (bool (default: False)) – Flip spot y-coordinates (maps y → img_size - y).

  • img_size (float (default: 2304)) – Image size in pixels (width and height). Used to correct coordinates after flipping.