LaboratoireMecaniqueLille / crappy

Command and Real-time Acquisition Parallelized in Python
https://crappy.readthedocs.io/en/stable/
GNU General Public License v2.0
78 stars 16 forks source link

Change name of images recorded by the `Camera` Block #104

Closed WeisLeDocto closed 6 months ago

WeisLeDocto commented 6 months ago

As reported in #98, the name of the images saved by the Camera Block (via the ImageSaver CameraProcess) is currently in the format f'{index}_{time:.3f}.{ext}'. Example image names: 1_0.100, 2_0.200, 21_2.100, etc. This poses problems for navigating in file explorers, or for compatibility with third -party processing software, as the first character in the name is used for sorting.

This PR changes the name of the recorded images to f'{index:06d}_{time:.3f}.{ext}', therefore adding a zero-padding as a prefix to the index to get at least 6 digits. The example names become 000001_0.100, 000002_0.200, 000021_2.100, etc. This PR fixes the sorting issue with file explorers and third-party software when less than 1 millions images are acquired. It preserves compatibility with the FileReader Camera without requiring changes in this file.