batch_to_tif#

Batch convert *.nd2 files to .tif images by calling to_tif.py. The code assumes the following folder structure:

main_folder
|-- day1
    |-- 00.nd2
|-- day2
    |-- 01.nd2

Syntax

python batch_to_tif.py main_folder
  • main_folder – the folder containing *.nd2 files.

Test

python batch_to_tif.py test_imagesatch_to_tif

Edit

  • Dec 14, 2021 – (i) Use system argument as input main folder, (ii) Implement main log file, (iii) Better doc string.

  • Jan 22, 2022 – Remove the log file and print all the information to stdout. When using the code, use >> to save the screen message to a file. It’s easier to locate the log file… This change should be applied to all the batch code.

  • Jan 05, 2023 – Adapt myimagelib import style.

  • Mar 09, 2023 – (i) add mode="r" for readdata, which looks for target file recursively. (ii) use in other folders