From 08b8f7399c8ad20cf5316382c13cf56114c4dd93 Mon Sep 17 00:00:00 2001 From: polarbean <harry.carey95@gmail.com> Date: Wed, 23 Oct 2024 21:44:53 +0200 Subject: [PATCH] removed redundant functions --- PyNutil/coordinate_processing.py | 19 ------------------- PyNutil/data_analysis.py | 7 +++---- PyNutil/main.py | 5 +++-- 3 files changed, 6 insertions(+), 25 deletions(-) delete mode 100644 PyNutil/coordinate_processing.py diff --git a/PyNutil/coordinate_processing.py b/PyNutil/coordinate_processing.py deleted file mode 100644 index 6633273..0000000 --- a/PyNutil/coordinate_processing.py +++ /dev/null @@ -1,19 +0,0 @@ -from .coordinate_extraction import folder_to_atlas_space -from .counting_and_load import label_points - - -def extract_coordinates(segmentation_folder, alignment_json, atlas_labels, pixel_id, non_linear, object_cutoff, atlas_volume, use_flat): - return folder_to_atlas_space( - segmentation_folder, - alignment_json, - atlas_labels, - pixel_id, - non_linear, - object_cutoff, - atlas_volume, - use_flat, - ) - - -def label_points_group(points, atlas_volume): - return label_points(points, atlas_volume, scale_factor=1) diff --git a/PyNutil/data_analysis.py b/PyNutil/data_analysis.py index ad5fd8d..ee8fff7 100644 --- a/PyNutil/data_analysis.py +++ b/PyNutil/data_analysis.py @@ -1,6 +1,5 @@ import pandas as pd -from .counting_and_load import pixel_count_per_region -from .coordinate_processing import label_points_group +from .counting_and_load import pixel_count_per_region, label_points def quantify_labeled_points( @@ -12,8 +11,8 @@ def quantify_labeled_points( atlas_labels, atlas_volume ): - labeled_points_centroids = label_points_group(centroids, atlas_volume) - labeled_points = label_points_group(pixel_points, atlas_volume) + labeled_points_centroids = label_points(centroids, atlas_volume) + labeled_points = label_points(pixel_points, atlas_volume, scale_factor=1) per_section_df = _quantify_per_section( labeled_points, diff --git a/PyNutil/main.py b/PyNutil/main.py index b4cd489..3255d35 100644 --- a/PyNutil/main.py +++ b/PyNutil/main.py @@ -2,9 +2,10 @@ import json import os from .io.atlas_loader import load_atlas_data, load_custom_atlas -from .coordinate_processing import extract_coordinates, label_points_group from .data_analysis import quantify_labeled_points from .io.file_operations import save_analysis_output +from .coordinate_extraction import folder_to_atlas_space +from .counting_and_load import label_points class PyNutil: @@ -64,7 +65,7 @@ class PyNutil: self.points_len, self.centroids_len, self.segmentation_filenames, - ) = extract_coordinates( + ) = folder_to_atlas_space( self.segmentation_folder, self.alignment_json, self.atlas_labels, -- GitLab