AutoMorphoTrack 1.0.5__tar.gz → 2.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/LICENSE.md +0 -0
  2. automorphotrack-2.0.1/MANIFEST.in +3 -0
  3. {automorphotrack-1.0.5/AutoMorphoTrack.egg-info → automorphotrack-2.0.1}/PKG-INFO +27 -29
  4. automorphotrack-2.0.1/README.md +93 -0
  5. automorphotrack-2.0.1/automorphotrack/.___init__.py +0 -0
  6. automorphotrack-2.0.1/automorphotrack/._colocalization.py +0 -0
  7. automorphotrack-2.0.1/automorphotrack/._detection.py +0 -0
  8. automorphotrack-2.0.1/automorphotrack/._lyso_count.py +0 -0
  9. automorphotrack-2.0.1/automorphotrack/._morphology.py +0 -0
  10. automorphotrack-2.0.1/automorphotrack/._motility.py +0 -0
  11. automorphotrack-2.0.1/automorphotrack/._shape_features.py +0 -0
  12. automorphotrack-2.0.1/automorphotrack/._shape_profiling.py +0 -0
  13. automorphotrack-2.0.1/automorphotrack/._summary.py +0 -0
  14. automorphotrack-2.0.1/automorphotrack/._tracking.py +0 -0
  15. automorphotrack-2.0.1/automorphotrack/._tracking_overlay.py +0 -0
  16. automorphotrack-2.0.1/automorphotrack/._utils.py +0 -0
  17. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/__init__.py +1 -1
  18. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/colocalization.py +10 -6
  19. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/detection.py +3 -3
  20. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/lyso_count.py +5 -5
  21. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/morphology.py +1 -1
  22. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/motility.py +13 -6
  23. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/shape_features.py +19 -8
  24. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/shape_profiling.py +1 -1
  25. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/summary.py +13 -4
  26. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/tracking.py +4 -4
  27. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/tracking_overlay.py +4 -4
  28. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/automorphotrack/utils.py +0 -0
  29. {automorphotrack-1.0.5 → automorphotrack-2.0.1/automorphotrack.egg-info}/PKG-INFO +27 -29
  30. automorphotrack-2.0.1/automorphotrack.egg-info/SOURCES.txt +34 -0
  31. automorphotrack-2.0.1/pyproject.toml +3 -0
  32. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/setup.py +11 -11
  33. automorphotrack-1.0.5/AutoMorphoTrack.egg-info/SOURCES.txt +0 -21
  34. automorphotrack-1.0.5/MANIFEST.in +0 -19
  35. automorphotrack-1.0.5/README.md +0 -95
  36. {automorphotrack-1.0.5/AutoMorphoTrack.egg-info → automorphotrack-2.0.1/automorphotrack.egg-info}/dependency_links.txt +0 -0
  37. {automorphotrack-1.0.5/AutoMorphoTrack.egg-info → automorphotrack-2.0.1/automorphotrack.egg-info}/requires.txt +0 -0
  38. {automorphotrack-1.0.5/AutoMorphoTrack.egg-info → automorphotrack-2.0.1/automorphotrack.egg-info}/top_level.txt +0 -0
  39. {automorphotrack-1.0.5 → automorphotrack-2.0.1}/setup.cfg +0 -0
@@ -0,0 +1,3 @@
1
+ include README.md
2
+ include LICENSE.md
3
+ recursive-include automorphotrack *.py
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
- Name: AutoMorphoTrack
3
- Version: 1.0.5
4
- Summary: AutoMorphoTrack is an open-source Python package for automated detection, morphology classification, motility tracking, and colocalization analysis of organelles in multichannel fluorescence microscopy data.
2
+ Name: automorphotrack
3
+ Version: 2.0.1
4
+ Summary: Automated pipeline for mitochondrial and lysosomal detection, tracking, morphology, and colocalization analysis in microscopy images.
5
5
  Home-page: https://github.com/abayatibrain/AMTpackage
6
- Author: Armin Bayati
6
+ Author: Armin Bayati, Ph.D.
7
7
  Author-email: a.bayati.brain@gmail.com
8
8
  License: MIT
9
9
  Project-URL: Documentation, https://github.com/abayatibrain/AMTpackage
@@ -40,45 +40,42 @@ Dynamic: summary
40
40
 
41
41
  # AutoMorphoTrack
42
42
 
43
- **AutoMorphoTrack** is an open-source Python package for automated detection, morphology classification, shape profiling, motility tracking, and colocalization analysis of subcellular organelles in multichannel fluorescence microscopy data.
43
+ **AutoMorphoTrack** is a modular image-analysis pipeline for automated detection, morphology classification, shape profiling, motility tracking, and colocalization analysis of mitochondria and lysosomes in multichannel fluorescence microscopy data.
44
44
 
45
- This package represents the fully modular version of the **AutoMorphoTrack pipeline**, originally developed as a Jupyter Notebook by **Armin Bayati, Ph.D.**, and now distributed as an installable Python framework.
46
- Repository: [https://github.com/abayatibrain/automorphotrack](https://github.com/abayatibrain/automorphotrack)
45
+ Developed by **Armin Bayati, Ph.D.**
47
46
 
48
47
  ---
49
48
 
50
49
  ## 🧬 Overview
51
50
 
52
- AutoMorphoTrack automates quantitative analysis of time-lapse `.tif` image stacks—typically dual-channel recordings of mitochondria and lysosomes—and generates publication-ready visual and numerical outputs at every step of the analysis pipeline.
51
+ AutoMorphoTrack processes time-lapse `.tif` stacks (typically two-channel: mitochondria + lysosomes) and generates publication-ready visual and quantitative outputs at every step.
53
52
 
54
53
  **Pipeline stages:**
55
54
 
56
55
  1. **Detection** – Organelle segmentation and outline visualization
57
- 2. **Lysosomal Counting** – Per-frame lysosome enumeration and temporal profiling
56
+ 2. **Lysosomal Counting** – Per-frame lysosome counts and plots
58
57
  3. **Morphology Classification** – Elongated vs. punctate mitochondria
59
- 4. **Shape Feature Extraction** – Area, circularity, solidity, aspect ratio, orientation
60
- 5. **Tracking** – Cumulative organelle trajectories (mitochondria, lysosomes, composite)
61
- 6. **Motility Analysis** – Velocity, displacement, and trajectory-based statistics
62
- 7. **Colocalization** – Bright-blue overlap overlays and correlation metrics
63
- 8. **Integrated Summary** – Correlation matrices linking morphology, motility, and overlap
64
-
65
- Each stage outputs high-resolution figures, videos, and CSV data tables stored in standardized subdirectories, ensuring reproducibility and compatibility with any image dataset.
58
+ 4. **Shape Feature Extraction** – Circularity, solidity, aspect ratio, orientation
59
+ 5. **Shape Profiling** – Combined violin plots of mitochondrial and lysosomal metrics
60
+ 6. **Tracking** – Cumulative organelle trajectories (mitochondria, lysosomes, composite)
61
+ 7. **Tracking Overlay** – Tracks drawn on real-intensity images
62
+ 8. **Motility Analysis** – Velocity and displacement distributions + scatter plots
63
+ 9. **Colocalization** – Bright-blue overlap visualization with Manders and Pearson coefficients
64
+ 10. **Integrated Summary** – Correlation matrix across all extracted metrics
66
65
 
67
66
  ---
68
67
 
69
- ## 📦 Installation
70
-
71
- Install directly from PyPI:
68
+ ## 📁 Installation
72
69
 
73
70
  ```bash
74
- pip install AutoMorphoTrack
71
+ pip install automorphotrack
75
72
  ```
76
73
 
77
- Or from source:
74
+ Or clone directly:
78
75
 
79
76
  ```bash
80
- git clone https://github.com/abayatibrain/automorphotrack.git
81
- cd automorphotrack
77
+ git clone https://github.com/abayatibrain/AutoMorphoTrack.git
78
+ cd AutoMorphoTrack
82
79
  pip install -e .
83
80
  ```
84
81
 
@@ -95,17 +92,17 @@ detect_organelles(tif_path)
95
92
  count_lysosomes_per_frame(tif_path)
96
93
  classify_morphology(tif_path)
97
94
  analyze_shape_features(tif_path)
95
+ profile_shape_data()
98
96
  track_organelles(tif_path)
97
+ track_overlay(tif_path)
99
98
  analyze_motility()
100
99
  analyze_colocalization(tif_path)
101
100
  summarize_integrated_data()
102
101
  ```
103
102
 
104
- Each function automatically generates visual and quantitative outputs at every step.
105
-
106
103
  ---
107
104
 
108
- ## 📁 Outputs
105
+ ## 📦 Outputs
109
106
 
110
107
  | Step | Output Type | Example Files |
111
108
  |------|--------------|---------------|
@@ -113,7 +110,9 @@ Each function automatically generates visual and quantitative outputs at every s
113
110
  | Lysosome Count | PNG + CSV + MP4 | `Lyso_Count_Plot.png`, `Lysosome_Counts.csv` |
114
111
  | Morphology | PNG + MP4 + CSV | `Morphology_Frame0_Labeled.png`, `Morphology_Labeled.mp4` |
115
112
  | Shape Features | PNG + CSV | `Shape_Distributions.png`, `Mito_ShapeMetrics.csv` |
113
+ | Shape Profiling | PNG + CSV | `Shape_ViolinPlots.png`, `Combined_ShapeData.csv` |
116
114
  | Tracking | PNG + MP4 + CSV | `Cumulative_Mito.png`, `Mito_Tracks.csv` |
115
+ | Tracking Overlay | PNG + MP4 | `Cumulative_Composite.png`, `Composite_CumulativeTracks.mp4` |
117
116
  | Motility | PNG + CSV | `Motility_Distributions.png`, `Motility_Scatter.png` |
118
117
  | Colocalization | PNG + MP4 + CSV | `Colocalization_Frame0.png`, `Colocalization.csv` |
119
118
  | Summary | PNG + CSV | `Integrated_CorrelationMatrix.png`, `Integrated_Merged_Data.csv` |
@@ -129,7 +128,6 @@ Each function automatically generates visual and quantitative outputs at every s
129
128
 
130
129
  ## 🧩 Citation
131
130
 
132
- If you use **AutoMorphoTrack** in your research, please cite:
131
+ If you use this pipeline in your work, please cite:
133
132
 
134
- > **Bayati, A. (2025)**. AutoMorphoTrack: An accessible Python framework for automated analysis of organelle morphology and motility.
135
- > *GitHub Repository:* [https://github.com/abayatibrain/automorphotrack](https://github.com/abayatibrain/automorphotrack)
133
+ > **Bayati, A. et al.** AutoMorphoTrack: Automated Organelle Tracking and Morphometric Profiling Toolkit (2025)
@@ -0,0 +1,93 @@
1
+ # AutoMorphoTrack
2
+
3
+ **AutoMorphoTrack** is a modular image-analysis pipeline for automated detection, morphology classification, shape profiling, motility tracking, and colocalization analysis of mitochondria and lysosomes in multichannel fluorescence microscopy data.
4
+
5
+ Developed by **Armin Bayati, Ph.D.**
6
+
7
+ ---
8
+
9
+ ## 🧬 Overview
10
+
11
+ AutoMorphoTrack processes time-lapse `.tif` stacks (typically two-channel: mitochondria + lysosomes) and generates publication-ready visual and quantitative outputs at every step.
12
+
13
+ **Pipeline stages:**
14
+
15
+ 1. **Detection** – Organelle segmentation and outline visualization
16
+ 2. **Lysosomal Counting** – Per-frame lysosome counts and plots
17
+ 3. **Morphology Classification** – Elongated vs. punctate mitochondria
18
+ 4. **Shape Feature Extraction** – Circularity, solidity, aspect ratio, orientation
19
+ 5. **Shape Profiling** – Combined violin plots of mitochondrial and lysosomal metrics
20
+ 6. **Tracking** – Cumulative organelle trajectories (mitochondria, lysosomes, composite)
21
+ 7. **Tracking Overlay** – Tracks drawn on real-intensity images
22
+ 8. **Motility Analysis** – Velocity and displacement distributions + scatter plots
23
+ 9. **Colocalization** – Bright-blue overlap visualization with Manders and Pearson coefficients
24
+ 10. **Integrated Summary** – Correlation matrix across all extracted metrics
25
+
26
+ ---
27
+
28
+ ## 📁 Installation
29
+
30
+ ```bash
31
+ pip install automorphotrack
32
+ ```
33
+
34
+ Or clone directly:
35
+
36
+ ```bash
37
+ git clone https://github.com/abayatibrain/AutoMorphoTrack.git
38
+ cd AutoMorphoTrack
39
+ pip install -e .
40
+ ```
41
+
42
+ ---
43
+
44
+ ## 🚀 Basic Usage
45
+
46
+ ```python
47
+ from automorphotrack import *
48
+
49
+ tif_path = "Composite.tif"
50
+
51
+ detect_organelles(tif_path)
52
+ count_lysosomes_per_frame(tif_path)
53
+ classify_morphology(tif_path)
54
+ analyze_shape_features(tif_path)
55
+ profile_shape_data()
56
+ track_organelles(tif_path)
57
+ track_overlay(tif_path)
58
+ analyze_motility()
59
+ analyze_colocalization(tif_path)
60
+ summarize_integrated_data()
61
+ ```
62
+
63
+ ---
64
+
65
+ ## 📦 Outputs
66
+
67
+ | Step | Output Type | Example Files |
68
+ |------|--------------|---------------|
69
+ | Detection | PNG + MP4 | `Mito_Frame0.png`, `Mitochondria_Detection.mp4` |
70
+ | Lysosome Count | PNG + CSV + MP4 | `Lyso_Count_Plot.png`, `Lysosome_Counts.csv` |
71
+ | Morphology | PNG + MP4 + CSV | `Morphology_Frame0_Labeled.png`, `Morphology_Labeled.mp4` |
72
+ | Shape Features | PNG + CSV | `Shape_Distributions.png`, `Mito_ShapeMetrics.csv` |
73
+ | Shape Profiling | PNG + CSV | `Shape_ViolinPlots.png`, `Combined_ShapeData.csv` |
74
+ | Tracking | PNG + MP4 + CSV | `Cumulative_Mito.png`, `Mito_Tracks.csv` |
75
+ | Tracking Overlay | PNG + MP4 | `Cumulative_Composite.png`, `Composite_CumulativeTracks.mp4` |
76
+ | Motility | PNG + CSV | `Motility_Distributions.png`, `Motility_Scatter.png` |
77
+ | Colocalization | PNG + MP4 + CSV | `Colocalization_Frame0.png`, `Colocalization.csv` |
78
+ | Summary | PNG + CSV | `Integrated_CorrelationMatrix.png`, `Integrated_Merged_Data.csv` |
79
+
80
+ ---
81
+
82
+ ## 🔧 Dependencies
83
+
84
+ - Python ≥ 3.9
85
+ - numpy, pandas, matplotlib, seaborn, opencv-python, scikit-image, scipy, tifffile
86
+
87
+ ---
88
+
89
+ ## 🧩 Citation
90
+
91
+ If you use this pipeline in your work, please cite:
92
+
93
+ > **Bayati, A. et al.** AutoMorphoTrack: Automated Organelle Tracking and Morphometric Profiling Toolkit (2025)
@@ -33,7 +33,7 @@
33
33
  # )
34
34
  # ============================================================
35
35
 
36
- __version__ = "1.0.0"
36
+ __version__ = "2.0.1"
37
37
  __author__ = "Armin Bayati"
38
38
 
39
39
  # --- Utility Imports ---
@@ -7,6 +7,10 @@ from skimage.filters import threshold_otsu
7
7
  from pathlib import Path
8
8
  from automorphotrack.utils import ensure_dir, save_high_dpi
9
9
 
10
+ # Colorblind-friendly palette
11
+ CB_MITO = "#0173B2" # blue
12
+ CB_LYSO = "#DE8F05" # orange
13
+
10
14
  def analyze_colocalization(
11
15
  tif_path="Composite.tif",
12
16
  mito_channel=0,
@@ -93,7 +97,7 @@ def analyze_colocalization(
93
97
  "Manders_M1": m1_list,
94
98
  "Manders_M2": m2_list,
95
99
  "Pearson_r": pearson_r,
96
- "Overlap_R": overlap_R,
100
+ "Cosine_Similarity": overlap_R, # Renamed from Overlap_R for clarity
97
101
  "Mito_TotalIntensity": mito_sum,
98
102
  "Lyso_TotalIntensity": lyso_sum
99
103
  }).to_csv(csv_path, index=False)
@@ -112,11 +116,11 @@ def analyze_colocalization(
112
116
  # ---------- Plot metrics ----------
113
117
  plot_path = Path(out_dir) / "Colocalization_MetricsPlot.png"
114
118
  fig, ax = plt.subplots(figsize=(10, 9))
115
- ax.plot(m1_list, 'r-', label='Manders M1 (mito→lyso)')
116
- ax.plot(m2_list, 'g-', label='Manders M2 (lyso→mito)')
117
- ax.plot(np.array(overlap_percent) / 100, 'b--', label='Overlap fraction')
118
- ax.plot(pearson_r, 'k-.', label='Pearson r')
119
- ax.plot(overlap_R, 'm:', label='Normalized R')
119
+ ax.plot(m1_list, color=CB_MITO, linestyle='-', label='Manders M1 (mito\u2192lyso)')
120
+ ax.plot(m2_list, color=CB_LYSO, linestyle='-', label='Manders M2 (lyso\u2192mito)')
121
+ ax.plot(np.array(overlap_percent) / 100, 'b--', label='Jaccard overlap fraction')
122
+ ax.plot(pearson_r, 'k-.', label='Pearson r (intensity)')
123
+ ax.plot(overlap_R, color='#CC79A7', linestyle=':', label='Cosine similarity')
120
124
  ax.set_xlabel("Frame")
121
125
  ax.set_ylabel("Coefficient / Fraction (0–1)")
122
126
  ax.set_ylim(0, 1)
@@ -12,7 +12,7 @@ from automorphotrack.utils import ensure_dir, write_video, upscale_frame
12
12
  def detect_mask(frame, ch, thr_factor=0.8, min_size=3):
13
13
  """Threshold and clean a single channel."""
14
14
  img = frame[..., ch].astype(float)
15
- img = (img - img.min()) / (img.ptp() + 1e-12)
15
+ img = (img - img.min()) / (np.ptp(img) + 1e-12)
16
16
  thr = threshold_otsu(img) * thr_factor
17
17
  mask = clear_border(binary_opening(img > thr, footprint=disk(1)))
18
18
  mask = remove_small_objects(mask, min_size)
@@ -41,7 +41,7 @@ def detect_organelles(
41
41
  mito_gray = (mito_img * 255).astype(np.uint8)
42
42
  mito_rgb = cv2.cvtColor(mito_gray, cv2.COLOR_GRAY2RGB)
43
43
  cnts, _ = cv2.findContours(mito_mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
44
- cv2.drawContours(mito_rgb, cnts, -1, (255, 0, 0), 1, cv2.LINE_AA)
44
+ cv2.drawContours(mito_rgb, cnts, -1, (1, 115, 178), 1, cv2.LINE_AA) # CB blue
45
45
  mito_frames.append(upscale_frame(mito_rgb, upscale_factor))
46
46
 
47
47
  # ----- Lysosomes (standard detection) -----
@@ -49,7 +49,7 @@ def detect_organelles(
49
49
  lyso_gray = (lyso_img * 255).astype(np.uint8)
50
50
  lyso_rgb = cv2.cvtColor(lyso_gray, cv2.COLOR_GRAY2RGB)
51
51
  cnts, _ = cv2.findContours(lyso_mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
52
- cv2.drawContours(lyso_rgb, cnts, -1, (0, 255, 0), 1, cv2.LINE_AA)
52
+ cv2.drawContours(lyso_rgb, cnts, -1, (222, 143, 5), 1, cv2.LINE_AA) # CB orange
53
53
  lyso_frames.append(upscale_frame(lyso_rgb, upscale_factor))
54
54
 
55
55
  # Save representative frames
@@ -12,7 +12,7 @@ from automorphotrack.utils import ensure_dir, write_video, upscale_frame
12
12
  def detect_mask(frame, ch, thr_factor=0.8, min_size=2):
13
13
  """Detect lysosomes in a single channel frame."""
14
14
  img = frame[..., ch].astype(float)
15
- img = (img - img.min()) / (img.ptp() + 1e-12)
15
+ img = (img - img.min()) / (np.ptp(img) + 1e-12)
16
16
  thr = threshold_otsu(img) * thr_factor
17
17
  mask = clear_border(binary_opening(img > thr, footprint=disk(1)))
18
18
  mask = remove_small_objects(mask, min_size)
@@ -42,15 +42,15 @@ def count_lysosomes_per_frame(
42
42
 
43
43
  lyso_gray = (lyso_img * 255).astype(np.uint8)
44
44
  lyso_rgb = cv2.cvtColor(lyso_gray, cv2.COLOR_GRAY2RGB)
45
- cv2.drawContours(lyso_rgb, cnts, -1, (0, 255, 0), 1, cv2.LINE_AA)
45
+ cv2.drawContours(lyso_rgb, cnts, -1, (222, 143, 5), 1, cv2.LINE_AA) # CB orange
46
46
 
47
- # Add small green numbers at each lysosome position
47
+ # Add small orange numbers at each lysosome position
48
48
  for i, c in enumerate(cnts):
49
49
  M = cv2.moments(c)
50
50
  if M["m00"] != 0:
51
51
  cx, cy = int(M["m10"] / M["m00"]), int(M["m01"] / M["m00"])
52
52
  cv2.putText(lyso_rgb, str(i + 1), (cx, cy),
53
- cv2.FONT_HERSHEY_SIMPLEX, 0.35, (0, 255, 0), 1, cv2.LINE_AA)
53
+ cv2.FONT_HERSHEY_SIMPLEX, 0.35, (222, 143, 5), 1, cv2.LINE_AA)
54
54
 
55
55
  # Add total count label in white (small font)
56
56
  cv2.putText(lyso_rgb, f"Count: {lyso_count}", (10, 18),
@@ -72,7 +72,7 @@ def count_lysosomes_per_frame(
72
72
 
73
73
  # Plot counts over frames
74
74
  plt.figure(figsize=(6, 4))
75
- plt.plot(df["Frame"], df["Lysosome_Count"], "-o", color="green")
75
+ plt.plot(df["Frame"], df["Lysosome_Count"], "-o", color="#DE8F05")
76
76
  plt.xlabel("Frame")
77
77
  plt.ylabel("Lysosome Count")
78
78
  plt.title("Lysosome Count per Frame")
@@ -13,7 +13,7 @@ from automorphotrack.utils import ensure_dir, upscale_frame, save_high_dpi
13
13
  def detect_mask(frame, ch, thr_factor=0.8, min_size=10):
14
14
  """Threshold a channel to obtain clean mitochondrial mask."""
15
15
  img = frame[..., ch].astype(float)
16
- img = (img - img.min()) / (img.ptp() + 1e-12)
16
+ img = (img - img.min()) / (np.ptp(img) + 1e-12)
17
17
  thr = threshold_otsu(img) * thr_factor
18
18
  mask = clear_border(binary_opening(img > thr, footprint=disk(1)))
19
19
  mask = remove_small_objects(mask, min_size)
@@ -6,6 +6,10 @@ import pandas as pd, numpy as np, matplotlib.pyplot as plt, seaborn as sns
6
6
  from pathlib import Path
7
7
  from automorphotrack.utils import ensure_dir, save_high_dpi
8
8
 
9
+ # Colorblind-friendly palette (Okabe-Ito inspired)
10
+ CB_MITO = "#0173B2" # blue
11
+ CB_LYSO = "#DE8F05" # orange
12
+
9
13
  def analyze_motility(
10
14
  mito_tracks_path="Tracking_Outputs/Mito_Tracks.csv",
11
15
  lyso_tracks_path="Tracking_Outputs/Lyso_Tracks.csv",
@@ -71,16 +75,19 @@ def analyze_motility(
71
75
 
72
76
  # ---------- Distribution Plots ----------
73
77
  fig, axes = plt.subplots(1, 2, figsize=(20, 8))
74
- sns.kdeplot(mito_summary["Mean_Velocity"], color="red", fill=True, ax=axes[0], label="Mitochondria")
75
- sns.kdeplot(lyso_summary["Mean_Velocity"], color="green", fill=True, alpha=0.4, ax=axes[0], label="Lysosomes")
78
+ # clip=(0, None) prevents KDE from extending into physically invalid negative values
79
+ sns.kdeplot(mito_summary["Mean_Velocity"], color=CB_MITO, fill=True, ax=axes[0], label="Mitochondria", clip=(0, None))
80
+ sns.kdeplot(lyso_summary["Mean_Velocity"], color=CB_LYSO, fill=True, alpha=0.4, ax=axes[0], label="Lysosomes", clip=(0, None))
76
81
  axes[0].set_title("Mean Velocity Distribution")
77
82
  axes[0].set_xlabel("Velocity (px/frame)")
83
+ axes[0].set_xlim(left=0)
78
84
  axes[0].legend()
79
85
 
80
- sns.kdeplot(mito_summary["Total_Displacement"], color="red", fill=True, ax=axes[1], label="Mitochondria")
81
- sns.kdeplot(lyso_summary["Total_Displacement"], color="green", fill=True, alpha=0.4, ax=axes[1], label="Lysosomes")
86
+ sns.kdeplot(mito_summary["Total_Displacement"], color=CB_MITO, fill=True, ax=axes[1], label="Mitochondria", clip=(0, None))
87
+ sns.kdeplot(lyso_summary["Total_Displacement"], color=CB_LYSO, fill=True, alpha=0.4, ax=axes[1], label="Lysosomes", clip=(0, None))
82
88
  axes[1].set_title("Total Displacement Distribution")
83
89
  axes[1].set_xlabel("Displacement (px)")
90
+ axes[1].set_xlim(left=0)
84
91
  axes[1].legend()
85
92
 
86
93
  plt.tight_layout()
@@ -89,9 +96,9 @@ def analyze_motility(
89
96
  # ---------- Scatter Plot ----------
90
97
  fig, ax = plt.subplots(figsize=(12, 10))
91
98
  sns.scatterplot(data=mito_summary, x="Total_Displacement", y="Mean_Velocity",
92
- color="red", s=30, label="Mitochondria")
99
+ color=CB_MITO, s=30, label="Mitochondria")
93
100
  sns.scatterplot(data=lyso_summary, x="Total_Displacement", y="Mean_Velocity",
94
- color="green", s=30, alpha=0.6, label="Lysosomes")
101
+ color=CB_LYSO, s=30, alpha=0.6, label="Lysosomes")
95
102
  ax.set_xlabel("Total Displacement (px)")
96
103
  ax.set_ylabel("Mean Velocity (px/frame)")
97
104
  ax.set_title("Motility Scatter Plot")
@@ -10,10 +10,14 @@ from skimage.segmentation import clear_border
10
10
  from pathlib import Path
11
11
  from automorphotrack.utils import ensure_dir, save_high_dpi, upscale_frame
12
12
 
13
+ # Colorblind-friendly palette (Okabe-Ito inspired)
14
+ CB_MITO = "#0173B2" # blue
15
+ CB_LYSO = "#DE8F05" # orange
16
+
13
17
  def detect_mask(frame, ch, min_size=3, thr_factor=0.8):
14
18
  """Threshold and clean a single channel."""
15
19
  img = frame[..., ch].astype(float)
16
- img = (img - img.min()) / (img.ptp() + 1e-12)
20
+ img = (img - img.min()) / (np.ptp(img) + 1e-12)
17
21
  thr = threshold_otsu(img) * thr_factor
18
22
  mask = clear_border(binary_opening(img > thr, footprint=disk(1)))
19
23
  mask = remove_small_objects(mask, min_size)
@@ -41,7 +45,11 @@ def analyze_shape_features(
41
45
  for p in regionprops(lbl_m):
42
46
  if p.area < 5:
43
47
  continue
44
- circ = (4 * np.pi * p.area) / (p.perimeter ** 2 + 1e-9)
48
+ # Use perimeter_crofton for more accurate continuous perimeter estimate
49
+ # to avoid circularity > 1 due to discrete pixel-boundary underestimation
50
+ perim = getattr(p, 'perimeter_crofton', p.perimeter)
51
+ circ = (4 * np.pi * p.area) / (perim ** 2 + 1e-9)
52
+ circ = min(circ, 1.0) # Clamp to [0, 1] for physical validity
45
53
  aspect = p.major_axis_length / (p.minor_axis_length + 1e-9)
46
54
  mito_records.append({
47
55
  "Frame": f,
@@ -59,7 +67,9 @@ def analyze_shape_features(
59
67
  for p in regionprops(lbl_l):
60
68
  if p.area < 5:
61
69
  continue
62
- circ = (4 * np.pi * p.area) / (p.perimeter ** 2 + 1e-9)
70
+ perim = getattr(p, 'perimeter_crofton', p.perimeter)
71
+ circ = (4 * np.pi * p.area) / (perim ** 2 + 1e-9)
72
+ circ = min(circ, 1.0) # Clamp to [0, 1] for physical validity
63
73
  aspect = p.major_axis_length / (p.minor_axis_length + 1e-9)
64
74
  lyso_records.append({
65
75
  "Frame": f,
@@ -82,14 +92,15 @@ def analyze_shape_features(
82
92
 
83
93
  # ---------- KDE Distribution Plots ----------
84
94
  fig, axes = plt.subplots(1, 2, figsize=(20, 8))
85
- sns.kdeplot(mito_df["Circularity"], ax=axes[0], color="red", fill=True, alpha=0.5, label="Mito")
86
- sns.kdeplot(lyso_df["Circularity"], ax=axes[0], color="green", fill=True, alpha=0.4, label="Lyso")
95
+ sns.kdeplot(mito_df["Circularity"], ax=axes[0], color=CB_MITO, fill=True, alpha=0.5, label="Mito", clip=(0, 1))
96
+ sns.kdeplot(lyso_df["Circularity"], ax=axes[0], color=CB_LYSO, fill=True, alpha=0.4, label="Lyso", clip=(0, 1))
87
97
  axes[0].set_title("Circularity Distribution")
88
- axes[0].set_xlabel("Circularity (4πA/P²)")
98
+ axes[0].set_xlabel("Circularity (4\u03C0A/P\u00B2)")
99
+ axes[0].set_xlim(0, 1)
89
100
  axes[0].legend(frameon=False)
90
101
 
91
- sns.kdeplot(mito_df["Solidity"], ax=axes[1], color="red", fill=True, alpha=0.5, label="Mito")
92
- sns.kdeplot(lyso_df["Solidity"], ax=axes[1], color="green", fill=True, alpha=0.4, label="Lyso")
102
+ sns.kdeplot(mito_df["Solidity"], ax=axes[1], color=CB_MITO, fill=True, alpha=0.5, label="Mito", clip=(0, 1))
103
+ sns.kdeplot(lyso_df["Solidity"], ax=axes[1], color=CB_LYSO, fill=True, alpha=0.4, label="Lyso", clip=(0, 1))
93
104
  axes[1].set_title("Solidity Distribution")
94
105
  axes[1].set_xlabel("Solidity")
95
106
  axes[1].legend(frameon=False)
@@ -34,7 +34,7 @@ def profile_shape_data(
34
34
  data=combined_df,
35
35
  x="Type",
36
36
  y=metric,
37
- palette={"Mitochondria": "red", "Lysosomes": "green"},
37
+ palette={"Mitochondria": "#0173B2", "Lysosomes": "#DE8F05"},
38
38
  cut=0,
39
39
  inner="quartile",
40
40
  ax=ax
@@ -3,6 +3,7 @@
3
3
  # ============================================================
4
4
 
5
5
  import pandas as pd, numpy as np, matplotlib.pyplot as plt, seaborn as sns
6
+ from scipy.stats import spearmanr
6
7
  from pathlib import Path
7
8
  from automorphotrack.utils import ensure_dir
8
9
 
@@ -44,10 +45,18 @@ def summarize_integrated_data(
44
45
  )
45
46
  print(f"Merged dataset dimensions: {merged.shape[0]} rows × {merged.shape[1]} columns")
46
47
 
47
- # ---------- Correlation computation ----------
48
+ # ---------- Correlation computation (Spearman rank) ----------
49
+ # Spearman is preferred over Pearson for biological morphometric data
50
+ # because many relationships are non-linear and distributions are non-normal
48
51
  numeric_cols = merged.select_dtypes(include=[np.number])
49
- corr = numeric_cols.corr().round(2)
50
- print("Correlation matrix computed")
52
+ cols = numeric_cols.columns
53
+ rho_matrix = np.zeros((len(cols), len(cols)))
54
+ for i, c1 in enumerate(cols):
55
+ for j, c2 in enumerate(cols):
56
+ rho, _ = spearmanr(numeric_cols[c1], numeric_cols[c2])
57
+ rho_matrix[i, j] = rho
58
+ corr = pd.DataFrame(rho_matrix, index=cols, columns=cols).round(2)
59
+ print("Spearman correlation matrix computed")
51
60
 
52
61
  # ---------- Save results ----------
53
62
  out_dir = Path(out_dir)
@@ -61,7 +70,7 @@ def summarize_integrated_data(
61
70
  # ---------- Plot correlation heatmap ----------
62
71
  fig, ax = plt.subplots(figsize=(28, 20))
63
72
  sns.heatmap(corr, annot=True, fmt=".2f", cmap="coolwarm", square=True)
64
- ax.set_title("Integrated Correlation Matrix – Shape, Motility, Colocalization", fontsize=14)
73
+ ax.set_title("Integrated Spearman Correlation Matrix \u2013 Shape, Motility, Colocalization", fontsize=14)
65
74
  plt.tight_layout()
66
75
  heatmap_path = out_dir / "Integrated_CorrelationMatrix.png"
67
76
  plt.savefig(heatmap_path, dpi=300)
@@ -98,11 +98,11 @@ def track_organelles(
98
98
  mito_frame, lyso_frame, comp_frame = frame_rgb.copy(), frame_rgb.copy(), frame_rgb.copy()
99
99
 
100
100
  for p1, p2 in mito_paths:
101
- cv2.line(mito_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])), (255, 0, 0), 1)
102
- cv2.line(comp_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])), (255, 0, 0), 1)
101
+ cv2.line(mito_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])), (1, 115, 178), 1)
102
+ cv2.line(comp_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])), (1, 115, 178), 1)
103
103
  for p1, p2 in lyso_paths:
104
- cv2.line(lyso_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])), (0, 255, 0), 1)
105
- cv2.line(comp_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])), (0, 255, 0), 1)
104
+ cv2.line(lyso_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])), (222, 143, 5), 1)
105
+ cv2.line(comp_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])), (222, 143, 5), 1)
106
106
 
107
107
  mito_frames.append(upscale_frame(mito_frame))
108
108
  lyso_frames.append(upscale_frame(lyso_frame))
@@ -95,14 +95,14 @@ def track_overlay(
95
95
 
96
96
  for p1, p2 in mito_paths:
97
97
  cv2.line(mito_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])),
98
- (255, 0, 0), line_thickness, cv2.LINE_AA)
98
+ (1, 115, 178), line_thickness, cv2.LINE_AA)
99
99
  cv2.line(comp_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])),
100
- (255, 0, 0), line_thickness, cv2.LINE_AA)
100
+ (1, 115, 178), line_thickness, cv2.LINE_AA)
101
101
  for p1, p2 in lyso_paths:
102
102
  cv2.line(lyso_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])),
103
- (0, 255, 0), line_thickness, cv2.LINE_AA)
103
+ (222, 143, 5), line_thickness, cv2.LINE_AA)
104
104
  cv2.line(comp_frame, tuple(np.int32(p1[::-1])), tuple(np.int32(p2[::-1])),
105
- (0, 255, 0), line_thickness, cv2.LINE_AA)
105
+ (222, 143, 5), line_thickness, cv2.LINE_AA)
106
106
 
107
107
  mito_frames.append(upscale_frame(mito_frame))
108
108
  lyso_frames.append(upscale_frame(lyso_frame))
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
- Name: AutoMorphoTrack
3
- Version: 1.0.5
4
- Summary: AutoMorphoTrack is an open-source Python package for automated detection, morphology classification, motility tracking, and colocalization analysis of organelles in multichannel fluorescence microscopy data.
2
+ Name: automorphotrack
3
+ Version: 2.0.1
4
+ Summary: Automated pipeline for mitochondrial and lysosomal detection, tracking, morphology, and colocalization analysis in microscopy images.
5
5
  Home-page: https://github.com/abayatibrain/AMTpackage
6
- Author: Armin Bayati
6
+ Author: Armin Bayati, Ph.D.
7
7
  Author-email: a.bayati.brain@gmail.com
8
8
  License: MIT
9
9
  Project-URL: Documentation, https://github.com/abayatibrain/AMTpackage
@@ -40,45 +40,42 @@ Dynamic: summary
40
40
 
41
41
  # AutoMorphoTrack
42
42
 
43
- **AutoMorphoTrack** is an open-source Python package for automated detection, morphology classification, shape profiling, motility tracking, and colocalization analysis of subcellular organelles in multichannel fluorescence microscopy data.
43
+ **AutoMorphoTrack** is a modular image-analysis pipeline for automated detection, morphology classification, shape profiling, motility tracking, and colocalization analysis of mitochondria and lysosomes in multichannel fluorescence microscopy data.
44
44
 
45
- This package represents the fully modular version of the **AutoMorphoTrack pipeline**, originally developed as a Jupyter Notebook by **Armin Bayati, Ph.D.**, and now distributed as an installable Python framework.
46
- Repository: [https://github.com/abayatibrain/automorphotrack](https://github.com/abayatibrain/automorphotrack)
45
+ Developed by **Armin Bayati, Ph.D.**
47
46
 
48
47
  ---
49
48
 
50
49
  ## 🧬 Overview
51
50
 
52
- AutoMorphoTrack automates quantitative analysis of time-lapse `.tif` image stacks—typically dual-channel recordings of mitochondria and lysosomes—and generates publication-ready visual and numerical outputs at every step of the analysis pipeline.
51
+ AutoMorphoTrack processes time-lapse `.tif` stacks (typically two-channel: mitochondria + lysosomes) and generates publication-ready visual and quantitative outputs at every step.
53
52
 
54
53
  **Pipeline stages:**
55
54
 
56
55
  1. **Detection** – Organelle segmentation and outline visualization
57
- 2. **Lysosomal Counting** – Per-frame lysosome enumeration and temporal profiling
56
+ 2. **Lysosomal Counting** – Per-frame lysosome counts and plots
58
57
  3. **Morphology Classification** – Elongated vs. punctate mitochondria
59
- 4. **Shape Feature Extraction** – Area, circularity, solidity, aspect ratio, orientation
60
- 5. **Tracking** – Cumulative organelle trajectories (mitochondria, lysosomes, composite)
61
- 6. **Motility Analysis** – Velocity, displacement, and trajectory-based statistics
62
- 7. **Colocalization** – Bright-blue overlap overlays and correlation metrics
63
- 8. **Integrated Summary** – Correlation matrices linking morphology, motility, and overlap
64
-
65
- Each stage outputs high-resolution figures, videos, and CSV data tables stored in standardized subdirectories, ensuring reproducibility and compatibility with any image dataset.
58
+ 4. **Shape Feature Extraction** – Circularity, solidity, aspect ratio, orientation
59
+ 5. **Shape Profiling** – Combined violin plots of mitochondrial and lysosomal metrics
60
+ 6. **Tracking** – Cumulative organelle trajectories (mitochondria, lysosomes, composite)
61
+ 7. **Tracking Overlay** – Tracks drawn on real-intensity images
62
+ 8. **Motility Analysis** – Velocity and displacement distributions + scatter plots
63
+ 9. **Colocalization** – Bright-blue overlap visualization with Manders and Pearson coefficients
64
+ 10. **Integrated Summary** – Correlation matrix across all extracted metrics
66
65
 
67
66
  ---
68
67
 
69
- ## 📦 Installation
70
-
71
- Install directly from PyPI:
68
+ ## 📁 Installation
72
69
 
73
70
  ```bash
74
- pip install AutoMorphoTrack
71
+ pip install automorphotrack
75
72
  ```
76
73
 
77
- Or from source:
74
+ Or clone directly:
78
75
 
79
76
  ```bash
80
- git clone https://github.com/abayatibrain/automorphotrack.git
81
- cd automorphotrack
77
+ git clone https://github.com/abayatibrain/AutoMorphoTrack.git
78
+ cd AutoMorphoTrack
82
79
  pip install -e .
83
80
  ```
84
81
 
@@ -95,17 +92,17 @@ detect_organelles(tif_path)
95
92
  count_lysosomes_per_frame(tif_path)
96
93
  classify_morphology(tif_path)
97
94
  analyze_shape_features(tif_path)
95
+ profile_shape_data()
98
96
  track_organelles(tif_path)
97
+ track_overlay(tif_path)
99
98
  analyze_motility()
100
99
  analyze_colocalization(tif_path)
101
100
  summarize_integrated_data()
102
101
  ```
103
102
 
104
- Each function automatically generates visual and quantitative outputs at every step.
105
-
106
103
  ---
107
104
 
108
- ## 📁 Outputs
105
+ ## 📦 Outputs
109
106
 
110
107
  | Step | Output Type | Example Files |
111
108
  |------|--------------|---------------|
@@ -113,7 +110,9 @@ Each function automatically generates visual and quantitative outputs at every s
113
110
  | Lysosome Count | PNG + CSV + MP4 | `Lyso_Count_Plot.png`, `Lysosome_Counts.csv` |
114
111
  | Morphology | PNG + MP4 + CSV | `Morphology_Frame0_Labeled.png`, `Morphology_Labeled.mp4` |
115
112
  | Shape Features | PNG + CSV | `Shape_Distributions.png`, `Mito_ShapeMetrics.csv` |
113
+ | Shape Profiling | PNG + CSV | `Shape_ViolinPlots.png`, `Combined_ShapeData.csv` |
116
114
  | Tracking | PNG + MP4 + CSV | `Cumulative_Mito.png`, `Mito_Tracks.csv` |
115
+ | Tracking Overlay | PNG + MP4 | `Cumulative_Composite.png`, `Composite_CumulativeTracks.mp4` |
117
116
  | Motility | PNG + CSV | `Motility_Distributions.png`, `Motility_Scatter.png` |
118
117
  | Colocalization | PNG + MP4 + CSV | `Colocalization_Frame0.png`, `Colocalization.csv` |
119
118
  | Summary | PNG + CSV | `Integrated_CorrelationMatrix.png`, `Integrated_Merged_Data.csv` |
@@ -129,7 +128,6 @@ Each function automatically generates visual and quantitative outputs at every s
129
128
 
130
129
  ## 🧩 Citation
131
130
 
132
- If you use **AutoMorphoTrack** in your research, please cite:
131
+ If you use this pipeline in your work, please cite:
133
132
 
134
- > **Bayati, A. (2025)**. AutoMorphoTrack: An accessible Python framework for automated analysis of organelle morphology and motility.
135
- > *GitHub Repository:* [https://github.com/abayatibrain/automorphotrack](https://github.com/abayatibrain/automorphotrack)
133
+ > **Bayati, A. et al.** AutoMorphoTrack: Automated Organelle Tracking and Morphometric Profiling Toolkit (2025)
@@ -0,0 +1,34 @@
1
+ LICENSE.md
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ setup.py
6
+ automorphotrack/.___init__.py
7
+ automorphotrack/._colocalization.py
8
+ automorphotrack/._detection.py
9
+ automorphotrack/._lyso_count.py
10
+ automorphotrack/._morphology.py
11
+ automorphotrack/._motility.py
12
+ automorphotrack/._shape_features.py
13
+ automorphotrack/._shape_profiling.py
14
+ automorphotrack/._summary.py
15
+ automorphotrack/._tracking.py
16
+ automorphotrack/._tracking_overlay.py
17
+ automorphotrack/._utils.py
18
+ automorphotrack/__init__.py
19
+ automorphotrack/colocalization.py
20
+ automorphotrack/detection.py
21
+ automorphotrack/lyso_count.py
22
+ automorphotrack/morphology.py
23
+ automorphotrack/motility.py
24
+ automorphotrack/shape_features.py
25
+ automorphotrack/shape_profiling.py
26
+ automorphotrack/summary.py
27
+ automorphotrack/tracking.py
28
+ automorphotrack/tracking_overlay.py
29
+ automorphotrack/utils.py
30
+ automorphotrack.egg-info/PKG-INFO
31
+ automorphotrack.egg-info/SOURCES.txt
32
+ automorphotrack.egg-info/dependency_links.txt
33
+ automorphotrack.egg-info/requires.txt
34
+ automorphotrack.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64", "wheel"]
3
+ build-backend = "setuptools.build_meta"
@@ -1,19 +1,19 @@
1
1
  from setuptools import setup, find_packages
2
+ import os
2
3
 
3
- # Read the README file for the long description
4
- with open("README.md", "r", encoding="utf-8") as fh:
5
- long_description = fh.read()
4
+ # Read README file (handle missing file gracefully for pip install from sdist)
5
+ long_description = ""
6
+ readme_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "README.md")
7
+ if os.path.exists(readme_path):
8
+ with open(readme_path, "r", encoding="utf-8") as fh:
9
+ long_description = fh.read()
6
10
 
7
11
  setup(
8
- name="AutoMorphoTrack",
9
- version="1.0.5",
10
- author="Armin Bayati",
12
+ name="automorphotrack",
13
+ version="2.0.1",
14
+ author="Armin Bayati, Ph.D.",
11
15
  author_email="a.bayati.brain@gmail.com",
12
- description=(
13
- "AutoMorphoTrack is an open-source Python package for automated detection, "
14
- "morphology classification, motility tracking, and colocalization analysis "
15
- "of organelles in multichannel fluorescence microscopy data."
16
- ),
16
+ description="Automated pipeline for mitochondrial and lysosomal detection, tracking, morphology, and colocalization analysis in microscopy images.",
17
17
  long_description=long_description,
18
18
  long_description_content_type="text/markdown",
19
19
  url="https://github.com/abayatibrain/AMTpackage",
@@ -1,21 +0,0 @@
1
- LICENSE.md
2
- MANIFEST.in
3
- README.md
4
- setup.py
5
- AutoMorphoTrack.egg-info/PKG-INFO
6
- AutoMorphoTrack.egg-info/SOURCES.txt
7
- AutoMorphoTrack.egg-info/dependency_links.txt
8
- AutoMorphoTrack.egg-info/requires.txt
9
- AutoMorphoTrack.egg-info/top_level.txt
10
- automorphotrack/__init__.py
11
- automorphotrack/colocalization.py
12
- automorphotrack/detection.py
13
- automorphotrack/lyso_count.py
14
- automorphotrack/morphology.py
15
- automorphotrack/motility.py
16
- automorphotrack/shape_features.py
17
- automorphotrack/shape_profiling.py
18
- automorphotrack/summary.py
19
- automorphotrack/tracking.py
20
- automorphotrack/tracking_overlay.py
21
- automorphotrack/utils.py
@@ -1,19 +0,0 @@
1
- # Include documentation and license files
2
- include README.md
3
- include LICENSE
4
- include requirements.txt
5
-
6
- # Include all Python source files
7
- recursive-include automorphotrack *.py
8
-
9
- # Include any additional data files (if present)
10
- recursive-include automorphotrack *.csv
11
- recursive-include automorphotrack *.txt
12
- recursive-include automorphotrack *.ipynb
13
- recursive-include automorphotrack *.png
14
- recursive-include automorphotrack *.jpg
15
- recursive-include automorphotrack *.tif
16
- recursive-include automorphotrack *.json
17
-
18
- # Exclude unnecessary system or cache files
19
- global-exclude __pycache__ *.py[cod] .DS_Store
@@ -1,95 +0,0 @@
1
- # AutoMorphoTrack
2
-
3
- **AutoMorphoTrack** is an open-source Python package for automated detection, morphology classification, shape profiling, motility tracking, and colocalization analysis of subcellular organelles in multichannel fluorescence microscopy data.
4
-
5
- This package represents the fully modular version of the **AutoMorphoTrack pipeline**, originally developed as a Jupyter Notebook by **Armin Bayati, Ph.D.**, and now distributed as an installable Python framework.
6
- Repository: [https://github.com/abayatibrain/automorphotrack](https://github.com/abayatibrain/automorphotrack)
7
-
8
- ---
9
-
10
- ## 🧬 Overview
11
-
12
- AutoMorphoTrack automates quantitative analysis of time-lapse `.tif` image stacks—typically dual-channel recordings of mitochondria and lysosomes—and generates publication-ready visual and numerical outputs at every step of the analysis pipeline.
13
-
14
- **Pipeline stages:**
15
-
16
- 1. **Detection** – Organelle segmentation and outline visualization
17
- 2. **Lysosomal Counting** – Per-frame lysosome enumeration and temporal profiling
18
- 3. **Morphology Classification** – Elongated vs. punctate mitochondria
19
- 4. **Shape Feature Extraction** – Area, circularity, solidity, aspect ratio, orientation
20
- 5. **Tracking** – Cumulative organelle trajectories (mitochondria, lysosomes, composite)
21
- 6. **Motility Analysis** – Velocity, displacement, and trajectory-based statistics
22
- 7. **Colocalization** – Bright-blue overlap overlays and correlation metrics
23
- 8. **Integrated Summary** – Correlation matrices linking morphology, motility, and overlap
24
-
25
- Each stage outputs high-resolution figures, videos, and CSV data tables stored in standardized subdirectories, ensuring reproducibility and compatibility with any image dataset.
26
-
27
- ---
28
-
29
- ## 📦 Installation
30
-
31
- Install directly from PyPI:
32
-
33
- ```bash
34
- pip install AutoMorphoTrack
35
- ```
36
-
37
- Or from source:
38
-
39
- ```bash
40
- git clone https://github.com/abayatibrain/automorphotrack.git
41
- cd automorphotrack
42
- pip install -e .
43
- ```
44
-
45
- ---
46
-
47
- ## 🚀 Basic Usage
48
-
49
- ```python
50
- from automorphotrack import *
51
-
52
- tif_path = "Composite.tif"
53
-
54
- detect_organelles(tif_path)
55
- count_lysosomes_per_frame(tif_path)
56
- classify_morphology(tif_path)
57
- analyze_shape_features(tif_path)
58
- track_organelles(tif_path)
59
- analyze_motility()
60
- analyze_colocalization(tif_path)
61
- summarize_integrated_data()
62
- ```
63
-
64
- Each function automatically generates visual and quantitative outputs at every step.
65
-
66
- ---
67
-
68
- ## 📁 Outputs
69
-
70
- | Step | Output Type | Example Files |
71
- |------|--------------|---------------|
72
- | Detection | PNG + MP4 | `Mito_Frame0.png`, `Mitochondria_Detection.mp4` |
73
- | Lysosome Count | PNG + CSV + MP4 | `Lyso_Count_Plot.png`, `Lysosome_Counts.csv` |
74
- | Morphology | PNG + MP4 + CSV | `Morphology_Frame0_Labeled.png`, `Morphology_Labeled.mp4` |
75
- | Shape Features | PNG + CSV | `Shape_Distributions.png`, `Mito_ShapeMetrics.csv` |
76
- | Tracking | PNG + MP4 + CSV | `Cumulative_Mito.png`, `Mito_Tracks.csv` |
77
- | Motility | PNG + CSV | `Motility_Distributions.png`, `Motility_Scatter.png` |
78
- | Colocalization | PNG + MP4 + CSV | `Colocalization_Frame0.png`, `Colocalization.csv` |
79
- | Summary | PNG + CSV | `Integrated_CorrelationMatrix.png`, `Integrated_Merged_Data.csv` |
80
-
81
- ---
82
-
83
- ## 🔧 Dependencies
84
-
85
- - Python ≥ 3.9
86
- - numpy, pandas, matplotlib, seaborn, opencv-python, scikit-image, scipy, tifffile
87
-
88
- ---
89
-
90
- ## 🧩 Citation
91
-
92
- If you use **AutoMorphoTrack** in your research, please cite:
93
-
94
- > **Bayati, A. (2025)**. AutoMorphoTrack: An accessible Python framework for automated analysis of organelle morphology and motility.
95
- > *GitHub Repository:* [https://github.com/abayatibrain/automorphotrack](https://github.com/abayatibrain/automorphotrack)