Skip to content

Commit

Permalink
Similarity clustering: add cache and simplify parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
tomka committed Jul 31, 2023
1 parent 340aa8f commit 3b1c03c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions django/applications/catmaid/control/similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,16 @@ def get(self, request:HttpRequest, project_id, similarity_id) -> JsonResponse:
type: boolean
required: false
defaultValue: false
- name: similarity_use_cache
description: Whether or not to use cached skeletons when recomputing similarities.
type: boolean
required: false
defaultValue: true
- name: similarity_simplify
description: Whether or not to simplify skeletons when recomputing similarities.
type: boolean
required: false
defaultValue: true
- name: min_x
description: The min X of the query bounding box
type: float
Expand Down Expand Up @@ -1601,6 +1611,8 @@ def get(self, request:HttpRequest, project_id, similarity_id) -> JsonResponse:
with_unclustered = get_request_bool(request.query_params, 'with_unclustered', False)
recompute_similarity = get_request_bool(request.query_params, 'recompute_similarity', False)
bb_pruned_similarity = get_request_bool(request.query_params, 'bb_pruned_similarity', False)
similarity_use_cache = get_request_bool(request.query_params, 'similarity_use_cache', True)
similarity_simplify = get_request_bool(request.query_params, 'similarity_simplify', True)

query_params = {
'project_id': project_id,
Expand Down Expand Up @@ -1644,6 +1656,7 @@ def get(self, request:HttpRequest, project_id, similarity_id) -> JsonResponse:
query_object_ids, target_object_ids, similarity.query_type_id,
similarity.target_type_id, remove_target_duplicates=False,
min_length=min_cable_length, min_soma_length=min_cable_length,
use_cache=similarity_use_cache, simplify=similarity_simplify,
normalized=similarity.normalized, use_alpha=similarity.use_alpha,
reverse=similarity.reverse, bb=bb, prune_bb=bb_pruned_similarity)
if scoring_info.get('errors'):
Expand Down

0 comments on commit 3b1c03c

Please sign in to comment.