Skip to content

Commit

Permalink
feature distance
Browse files Browse the repository at this point in the history
  • Loading branch information
kapoorlab committed Apr 14, 2024
1 parent 9ec1a1f commit ca0afd1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions src/napatrackmater/Trackvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,7 @@ def simple_unsupervised_clustering(
metric="euclidean",
method="centroid",
criterion="distance",
distance_vectors="shape",
):

csv_file_name_original = csv_file_name
Expand Down Expand Up @@ -1478,6 +1479,7 @@ def simple_unsupervised_clustering(
cluster_threshold_dynamic,
cluster_threshold_shape,
criterion,
distance_vectors=distance_vectors,
)

silhouette_file_name = os.path.join(
Expand Down Expand Up @@ -1583,6 +1585,7 @@ def unsupervised_clustering(
metric="euclidean",
method="ward",
criterion="maxclust",
distance_vectors="shape",
):

csv_file_name_original = csv_file_name
Expand Down Expand Up @@ -1681,6 +1684,7 @@ def unsupervised_clustering(
cluster_threshold_dynamic,
cluster_threshold_shape,
criterion,
distance_vectors=distance_vectors,
)

silhouette_file_name = os.path.join(
Expand Down Expand Up @@ -2030,6 +2034,7 @@ def convert_tracks_to_simple_arrays(
method="ward",
criterion="maxclust",
t_delta=10,
distance_vectors="shape",
):

analysis_track_ids = []
Expand Down Expand Up @@ -2137,6 +2142,7 @@ def convert_tracks_to_simple_arrays(
cluster_threshold_dynamic,
cluster_threshold_shape,
criterion,
distance_vectors=distance_vectors,
)

shape_dynamic_cluster_labels_dict = {
Expand Down Expand Up @@ -2283,7 +2289,8 @@ def core_clustering(
shape_eigenvectors_1d = np.array(shape_eigenvectors_2d)
dynamic_eigenvectors_1d = np.array(dynamic_eigenvectors_2d)
position_vector_1d = np.array(position_vector_2d)

compute_vectors_shape = shape_eigenvectors_1d
compute_vectors_dynamic = dynamic_eigenvectors_1d
if distance_vectors == "shape":
compute_vectors = shape_eigenvectors_1d
if distance_vectors == "dynamic":
Expand Down Expand Up @@ -2377,7 +2384,7 @@ def core_clustering(
)

cluster_distance_map_dynamic = calculate_intercluster_distance(
compute_vectors, dynamic_cluster_labels
compute_vectors_shape, dynamic_cluster_labels
)
cluster_eucledian_distance_map_dynamic = (
calculate_intercluster_eucledian_distance(
Expand Down Expand Up @@ -2435,7 +2442,7 @@ def core_clustering(
shape_eigenvectors_1d, shape_cluster_labels
)
cluster_distance_map_shape = calculate_intercluster_distance(
compute_vectors, shape_cluster_labels
compute_vectors_dynamic, shape_cluster_labels
)
cluster_eucledian_distance_map_shape = (
calculate_intercluster_eucledian_distance(
Expand Down
4 changes: 2 additions & 2 deletions src/napatrackmater/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = version = "5.1.0"
__version_tuple__ = version_tuple = (5, 1, 0)
__version__ = version = "5.1.1"
__version_tuple__ = version_tuple = (5, 1, 1)

0 comments on commit ca0afd1

Please sign in to comment.