Mercurial > repos > imgteam > slice_image
comparison slice_image.py @ 4:a72590196440 draft default tip
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/slice_image/ commit c86a1b93cb7732f7331a981d13465653cc1a2790
author | imgteam |
---|---|
date | Wed, 24 Apr 2024 08:13:20 +0000 |
parents | 1faa7e3c94ff |
children |
comparison
equal
deleted
inserted
replaced
3:1faa7e3c94ff | 4:a72590196440 |
---|---|
1 import argparse | 1 import argparse |
2 import os.path | 2 import os.path |
3 import random | 3 import random |
4 import warnings | 4 import warnings |
5 | 5 |
6 import giatools.io | |
6 import numpy as np | 7 import numpy as np |
7 import skimage.feature | 8 import skimage.feature |
8 import skimage.io | 9 import skimage.io |
9 import skimage.util | 10 import skimage.util |
10 | 11 |
13 | 14 |
14 # Primarily for testing purposes | 15 # Primarily for testing purposes |
15 if seed is not None: | 16 if seed is not None: |
16 random.seed(seed) | 17 random.seed(seed) |
17 | 18 |
18 img_raw = skimage.io.imread(input_file) | 19 img_raw = giatools.io.imread(input_file) |
19 if len(img_raw.shape) == 2: | 20 if len(img_raw.shape) == 2: |
20 img_raw = np.expand_dims(img_raw, 3) | 21 img_raw = np.expand_dims(img_raw, 3) |
21 | 22 |
22 with warnings.catch_warnings(): # ignore FutureWarning | 23 with warnings.catch_warnings(): # ignore FutureWarning |
23 warnings.simplefilter("ignore") | 24 warnings.simplefilter("ignore") |