Skip to content

Commit

Permalink
Merge remote-tracking branch 'uliege/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
urubens committed Aug 6, 2020
2 parents 947d781 + 0ad60a4 commit fe056ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cytomine/utilities/software.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def setup_classify(args, logger, root_path=None, image_folder="images", set_fold
zoom_level = args.cytomine_zoom_level
base_path = os.path.join(base_path, "zoom_level", str(zoom_level))
if hasattr(args, "cytomine_download_alpha"):
# to download the alphamask as a fourth channel
download_alpha = args.cytomine_download_alpha
base_path = os.path.join(base_path, "alpha", str(int(download_alpha)))
if set_folder is not None:
Expand Down Expand Up @@ -110,14 +111,15 @@ def setup_classify(args, logger, root_path=None, image_folder="images", set_fold
)

if 'showTerm' in annot_params and not keep_without_term:
annotations = annotations.filter(lambda a: hasattr(a, '__len__') and len(a.term) > 0)
annotations = annotations.filter(lambda a: hasattr(a.term, '__len__') and len(a.term) > 0)

# download annotations
logger.abs_update(progress=65, statusComment="Download crops of annotations.")
downloaded = annotations.dump_crops(
dest_pattern=os.path.join(base_path, dest_pattern),
override=True,
alpha=download_alpha,
mask=download_alpha,
zoom=zoom_level,
n_workers=args.n_jobs
)
Expand Down

0 comments on commit fe056ae

Please sign in to comment.