annotate cp_segmentation.py @ 2:e5370bb71633 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
author bgruening
date Sat, 15 Mar 2025 17:23:55 +0000
parents 1857781df226
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
1 import argparse
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
2 import json
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
3 import os
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
4 import warnings
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
5
2
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
6 # Make sure, that `MKL_NUM_THREADS` is set to 1, to ensure reproducibility:
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
7 # https://forum.image.sc/t/reproducibility-how-we-spent-years-building-containers-and-then-mkl-decided-to-screw-our-results/109599
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
8 if str(os.environ['MKL_NUM_THREADS']) != '1':
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
9 warnings.warn('MKL_NUM_THREADS must be set to 1 to ensure reproducibility, and will be adjusted accordingly for now.')
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
10 os.environ['MKL_NUM_THREADS'] = '1'
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
11
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
12 # Load the remaining packages *after* adjusting `MKL_NUM_THREADS` (this likely necessary for it to take effect)
0
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
13 import matplotlib.pyplot as plt
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
14 import numpy as np
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
15 import skimage.io
2
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
16 import torch
0
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
17 from cellpose import models, plot, transforms
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
18
2
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
19 # Apply PyTorch guidelines for reproducibility
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
20 torch.backends.cudnn.benchmark = True
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
21 torch.backends.cudnn.deterministic = True
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
22 torch.manual_seed(0)
e5370bb71633 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 5846f23282167df28e6cc00e1bda31523b66b5b4
bgruening
parents: 1
diff changeset
23
0
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
24
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
25 def main(inputs, img_path, img_format, output_dir):
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
26 """
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
27 Parameter
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
28 ---------
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
29 inputs : str
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
30 File path to galaxy tool parameter
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
31 img_path : str
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
32 File path for the input image
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
33 img_format : str
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
34 One of the ['ome.tiff', 'tiff', 'png', 'jpg']
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
35 output_dir : str
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
36 Folder to save the outputs.
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
37 """
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
38 warnings.simplefilter('ignore')
1
1857781df226 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit 81c6be8cc2502367ae52bf093b838e9764b22c00
bgruening
parents: 0
diff changeset
39 np.random.seed(42)
0
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
40 with open(inputs, 'r') as param_handler:
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
41 params = json.load(param_handler)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
42
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
43 gpu = params['use_gpu']
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
44 model_type = params['model_type']
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
45 chan = params['chan']
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
46 chan2 = params['chan2']
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
47 chan_first = params['chan_first']
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
48 if chan is None:
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
49 channels = None
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
50 else:
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
51 channels = [int(chan), int(chan2) if chan2 is not None else None]
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
52
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
53 options = params['options']
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
54
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
55 img = skimage.io.imread(img_path)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
56
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
57 print(f"Image shape: {img.shape}")
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
58 # transpose to Ly x Lx x nchann and reshape based on channels
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
59 if img_format.endswith('tiff'):
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
60 img = np.transpose(img, (1, 2, 0))
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
61 img = transforms.reshape(img, channels=channels, chan_first=chan_first)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
62
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
63 print(f"Image shape: {img.shape}")
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
64 model = models.Cellpose(gpu=gpu, model_type=model_type)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
65 masks, flows, styles, diams = model.eval(img, channels=channels, **options)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
66
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
67 # save masks to tiff
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
68 with warnings.catch_warnings():
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
69 warnings.simplefilter("ignore")
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
70 skimage.io.imsave(os.path.join(output_dir, 'cp_masks.tif'),
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
71 masks.astype(np.uint16))
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
72
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
73 # make segmentation show #
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
74 if params['show_segmentation']:
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
75 img = skimage.io.imread(img_path)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
76 # uniform image
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
77 if img_format.endswith('tiff'):
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
78 img = np.transpose(img, (1, 2, 0))
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
79 img = transforms.reshape(img, channels=channels, chan_first=chan_first)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
80
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
81 maski = masks
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
82 flowi = flows[0]
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
83 fig = plt.figure(figsize=(12, 3))
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
84 # can save images (set save_dir=None if not)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
85 plot.show_segmentation(fig, img, maski, flowi, channels=channels)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
86 fig.savefig(os.path.join(output_dir, 'segm_show.png'), dpi=300)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
87 plt.close(fig)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
88
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
89
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
90 if __name__ == '__main__':
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
91 aparser = argparse.ArgumentParser()
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
92 aparser.add_argument("-i", "--inputs", dest="inputs", required=True)
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
93 aparser.add_argument("-p", "--img_path", dest="img_path")
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
94 aparser.add_argument("-f", "--img_format", dest="img_format")
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
95 aparser.add_argument("-O", "--output_dir", dest="output_dir")
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
96 args = aparser.parse_args()
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
97
4ddb0af5a806 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/cellpose commit e80ca9b0e2e6f7ae94371170d0a672f46f2d9c3c
bgruening
parents:
diff changeset
98 main(args.inputs, args.img_path, args.img_format, args.output_dir)