lattice-sub 1.3.0__tar.gz → 1.3.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.
- {lattice_sub-1.3.0/src/lattice_sub.egg-info → lattice_sub-1.3.1}/PKG-INFO +1 -1
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/pyproject.toml +1 -1
- {lattice_sub-1.3.0 → lattice_sub-1.3.1/src/lattice_sub.egg-info}/PKG-INFO +1 -1
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_subtraction/__init__.py +1 -1
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_subtraction/visualization.py +28 -26
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/LICENSE +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/MANIFEST.in +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/README.md +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/docs/images/example_comparison.png +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/docs/images/threshold_analysis.png +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/examples/config.yaml +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/examples/converted_params.yaml +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/setup.cfg +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_sub.egg-info/SOURCES.txt +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_sub.egg-info/dependency_links.txt +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_sub.egg-info/entry_points.txt +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_sub.egg-info/requires.txt +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_sub.egg-info/top_level.txt +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_subtraction/batch.py +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_subtraction/cli.py +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_subtraction/config.py +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_subtraction/core.py +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_subtraction/io.py +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_subtraction/masks.py +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_subtraction/processing.py +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_subtraction/threshold_optimizer.py +0 -0
- {lattice_sub-1.3.0 → lattice_sub-1.3.1}/src/lattice_subtraction/ui.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lattice-sub
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: Lattice subtraction for cryo-EM micrographs - removes periodic crystal signals to reveal non-periodic features
|
|
5
5
|
Author-email: George Stephenson <george.stephenson@colorado.edu>, Vignesh Kasinath <vignesh.kasinath@colorado.edu>
|
|
6
6
|
License: MIT
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "lattice-sub"
|
|
7
|
-
version = "1.3.
|
|
7
|
+
version = "1.3.1"
|
|
8
8
|
description = "Lattice subtraction for cryo-EM micrographs - removes periodic crystal signals to reveal non-periodic features"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lattice-sub
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: Lattice subtraction for cryo-EM micrographs - removes periodic crystal signals to reveal non-periodic features
|
|
5
5
|
Author-email: George Stephenson <george.stephenson@colorado.edu>, Vignesh Kasinath <vignesh.kasinath@colorado.edu>
|
|
6
6
|
License: MIT
|
|
@@ -139,13 +139,15 @@ def create_comparison_figure_with_threshold(
|
|
|
139
139
|
optimal_threshold: float,
|
|
140
140
|
optimal_quality: float,
|
|
141
141
|
title: str = "Lattice Subtraction Comparison",
|
|
142
|
-
figsize: Tuple[int, int] = (
|
|
142
|
+
figsize: Tuple[int, int] = (14, 12),
|
|
143
143
|
dpi: int = 150,
|
|
144
144
|
):
|
|
145
145
|
"""
|
|
146
146
|
Create a 4-panel comparison figure with threshold optimization curve.
|
|
147
147
|
|
|
148
|
-
Layout
|
|
148
|
+
Layout (2x2 grid):
|
|
149
|
+
[Original] [Subtracted]
|
|
150
|
+
[Difference] [Threshold Curve]
|
|
149
151
|
|
|
150
152
|
Args:
|
|
151
153
|
original: Original image array
|
|
@@ -166,44 +168,44 @@ def create_comparison_figure_with_threshold(
|
|
|
166
168
|
# Compute difference
|
|
167
169
|
difference = original - processed
|
|
168
170
|
|
|
169
|
-
# Create figure with 4 panels (
|
|
170
|
-
fig, axes = plt.subplots(
|
|
171
|
+
# Create figure with 4 panels (2 rows, 2 columns)
|
|
172
|
+
fig, axes = plt.subplots(2, 2, figsize=figsize)
|
|
171
173
|
|
|
172
174
|
# Contrast limits from original
|
|
173
175
|
vmin, vmax = np.percentile(original, [1, 99])
|
|
174
176
|
|
|
175
|
-
# Panel 1: Original
|
|
176
|
-
axes[0].imshow(original, cmap='gray', vmin=vmin, vmax=vmax)
|
|
177
|
-
axes[0].set_title(f'Original\n{original.shape}')
|
|
178
|
-
axes[0].axis('off')
|
|
177
|
+
# Panel 1 (top-left): Original
|
|
178
|
+
axes[0, 0].imshow(original, cmap='gray', vmin=vmin, vmax=vmax)
|
|
179
|
+
axes[0, 0].set_title(f'Original\n{original.shape}')
|
|
180
|
+
axes[0, 0].axis('off')
|
|
179
181
|
|
|
180
|
-
# Panel 2: Lattice Subtracted
|
|
181
|
-
axes[1].imshow(processed, cmap='gray', vmin=vmin, vmax=vmax)
|
|
182
|
-
axes[1].set_title(f'Lattice Subtracted\n{processed.shape}')
|
|
183
|
-
axes[1].axis('off')
|
|
182
|
+
# Panel 2 (top-right): Lattice Subtracted
|
|
183
|
+
axes[0, 1].imshow(processed, cmap='gray', vmin=vmin, vmax=vmax)
|
|
184
|
+
axes[0, 1].set_title(f'Lattice Subtracted\n{processed.shape}')
|
|
185
|
+
axes[0, 1].axis('off')
|
|
184
186
|
|
|
185
|
-
# Panel 3: Difference (removed lattice)
|
|
187
|
+
# Panel 3 (bottom-left): Difference (removed lattice)
|
|
186
188
|
diff_std = np.std(difference)
|
|
187
|
-
axes[
|
|
189
|
+
axes[1, 0].imshow(
|
|
188
190
|
difference,
|
|
189
191
|
cmap='RdBu_r',
|
|
190
192
|
vmin=-diff_std * 3,
|
|
191
193
|
vmax=diff_std * 3
|
|
192
194
|
)
|
|
193
|
-
axes[
|
|
194
|
-
axes[
|
|
195
|
+
axes[1, 0].set_title('Difference (Removed Lattice)')
|
|
196
|
+
axes[1, 0].axis('off')
|
|
195
197
|
|
|
196
|
-
# Panel 4: Threshold vs Quality Score curve
|
|
197
|
-
axes[
|
|
198
|
-
axes[
|
|
198
|
+
# Panel 4 (bottom-right): Threshold vs Quality Score curve
|
|
199
|
+
axes[1, 1].plot(thresholds, quality_scores, 'b-', linewidth=2, label='Quality Score')
|
|
200
|
+
axes[1, 1].axvline(x=optimal_threshold, color='r', linestyle='--', linewidth=2,
|
|
199
201
|
label=f'Optimal: {optimal_threshold:.3f}')
|
|
200
|
-
axes[
|
|
201
|
-
axes[
|
|
202
|
-
axes[
|
|
203
|
-
axes[
|
|
204
|
-
axes[
|
|
205
|
-
axes[
|
|
206
|
-
axes[
|
|
202
|
+
axes[1, 1].scatter([optimal_threshold], [optimal_quality], color='r', s=100, zorder=5)
|
|
203
|
+
axes[1, 1].set_xlabel('Threshold', fontsize=11)
|
|
204
|
+
axes[1, 1].set_ylabel('Lattice Removal Efficacy', fontsize=11)
|
|
205
|
+
axes[1, 1].set_title(f'Threshold Optimization\nOptimal = {optimal_threshold:.3f}')
|
|
206
|
+
axes[1, 1].legend(loc='best', fontsize=9)
|
|
207
|
+
axes[1, 1].grid(True, alpha=0.3)
|
|
208
|
+
axes[1, 1].set_xlim(thresholds.min(), thresholds.max())
|
|
207
209
|
|
|
208
210
|
# Title
|
|
209
211
|
plt.suptitle(title, fontsize=14)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|