megafish.utils module
- natural_sort(list_to_sort)[source]
Sorts a list of strings in natural order, where numerical values are ordered as numbers, not as individual characters.
- Parameters:
list_to_sort (list of str) – The list of strings to be sorted.
- Returns:
A new list sorted in natural order.
- Return type:
Example
natural_sort([‘file2.txt’, ‘file10.txt’, ‘file1.txt’]) -> [‘file1.txt’, ‘file2.txt’, ‘file10.txt’]
- get_tile_yx(n_tile_y, n_tile_x, scan_type)[source]
Generates a list of (y, x) coordinates for tiles scanned according to a specified pattern.
- Parameters:
- Returns:
A list of (y, x) coordinates for each tile.
- Return type:
- Raises:
ValueError – If the scan_type is not supported.