Skip to content

Commit f0aa6c8

Browse files
committed
Add LIF to TIFF conversion command line tool
1 parent 06e4bcf commit f0aa6c8

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ murfey = "murfey.client:run"
7979
"murfey.decrypt_password" = "murfey.cli.decrypt_db_password:run"
8080
"murfey.generate_key" = "murfey.cli.generate_crypto_key:run"
8181
"murfey.generate_password" = "murfey.cli.generate_db_password:run"
82+
"murfey.lif_to_tiff" = "murfey.cli.lif_to_tiff:run"
8283
"murfey.server" = "murfey.server:run"
8384
"murfey.sessions" = "murfey.cli.db_sessions:run"
8485
"murfey.simulate" = "murfey.cli.dummy:run"

src/murfey/cli/lif_to_tiff.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import argparse
2+
from pathlib import Path
3+
4+
from murfey.util.lif import convert_lif_to_tiff
5+
6+
7+
def run():
8+
parser = argparse.ArgumentParser(description="Convert LIF to TIFF")
9+
10+
parser.add_argument(
11+
nargs=1, dest="lif_path", help="Path to LIF file for conversion"
12+
)
13+
parser.add_argument(
14+
"--root-dir",
15+
default="images",
16+
type=str,
17+
help="Top subdirectory that LIF files are stored in. Used to determine destination of TIFFs",
18+
)
19+
parser.add_argument(
20+
"-n", "--num-procs", default=1, type=int, help="Number of processes"
21+
)
22+
23+
args = parser.parse_args()
24+
25+
convert_lif_to_tiff(
26+
Path(args.lif_path),
27+
root_folder=args.root_dir,
28+
number_of_processes=args.num_procs,
29+
)

0 commit comments

Comments
 (0)