imageloader

load_files(ad:str)
Load and return a naturally sorted list of image file names from a directory. This function scans the specified directory and collects the names of all files with valid image file extensions. It then returns the list in natural (human-friendly) order.
Parameters:
Returns:
List[str]: A naturally sorted list of image file names with valid extensions.
Examples:
>>> load_files("/path/to/images")
['image1.png', 'image2.png', 'image10.png']
Notes:
- Supported extensions include: 'tiff', 'tif', 'png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp'.
- Sorting is done using `natsort.natsorted` to ensure human-friendly ordering (e.g., 1, 2, 10).
See_also:
- `os.listdir`: For listing files in a directory.
- `natsort.natsorted`: For performing natural sorting.
Caution:
Files without an extension or with an unsupported extension are ignored silently.
Warning:
Only file names are returned (not full paths). You must join with `ad` if you need full paths.
Aurhor:
- Sajjad Shumaly
Labels:

src_PyThon_ContactAngle_CaMeasurer_imageloader_load_files

read_four_integers(file_path:str)
Read exactly four integers from the first line of a text file. This function opens the specified file, reads the first line, splits it by whitespace, and attempts to parse exactly four integers. If the line does not contain four integers, a ValueError is raised.
Parameters:
Returns:
List[int]: A list of four integers read from the file.
Raises:
Examples:
File content:
12 34 56 78
>>> read_four_integers("input.txt")
[12, 34, 56, 78]
Notes:
- Extra spaces or tabs between numbers are allowed.
- Non-integer values will raise a ValueError during conversion.
Caution:
Only the first line is read; remaining lines are ignored.
Labels:

src_PyThon_ContactAngle_CaMeasurer_imageloader_read_four_integers