Skip to content

Commit

Permalink
sort args.magnifications in an increasing order: allows to pass `--ma…
Browse files Browse the repository at this point in the history
…gnifications 0 2` and `--magnifications 2 0` with the same effect; works for a single magnification
  • Loading branch information
GeorgeBatch committed Feb 27, 2023
1 parent a206dd9 commit 217ac7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepzoom_tiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def nested_patches(img_slide, out_base, level=(0,), ext='jpeg'):
parser.add_argument('-o', '--objective', type=float, default=20, help='The default objective power if metadata does not present [20]')
parser.add_argument('-t', '--background_t', type=int, default=15, help='Threshold for filtering background [15]')
args = parser.parse_args()
levels = tuple(args.magnifications)
levels = tuple(sorted(args.magnifications))
assert len(levels)<=2, 'Only 1 or 2 magnifications are supported!'
path_base = os.path.join('WSI', args.dataset)
if len(levels) == 2:
Expand Down

0 comments on commit 217ac7f

Please sign in to comment.