lattice-sub 1.3.0__py3-none-any.whl → 1.3.1__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lattice-sub
3
- Version: 1.3.0
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
@@ -1,5 +1,5 @@
1
- lattice_sub-1.3.0.dist-info/licenses/LICENSE,sha256=2kPoH0cbEp0cVEGqMpyF2IQX1npxdtQmWJB__HIRSb0,1101
2
- lattice_subtraction/__init__.py,sha256=TNaJXvSgCQdvYUYJfS5scn92YjORiGfLot9WadZ8u28,1737
1
+ lattice_sub-1.3.1.dist-info/licenses/LICENSE,sha256=2kPoH0cbEp0cVEGqMpyF2IQX1npxdtQmWJB__HIRSb0,1101
2
+ lattice_subtraction/__init__.py,sha256=KL12LDW3dzz_JSBMGIo6UJ3_9vw7oooF7z7EG5P3i4Y,1737
3
3
  lattice_subtraction/batch.py,sha256=zJzvUnr8dznvxE8jaPKDLJ7AcJg8Cbfv5nVo0FzZz1I,20891
4
4
  lattice_subtraction/cli.py,sha256=W99XQClUMKaaFQxle0W-ILQ6UuYRFXZVJWD4qXpcIj4,24063
5
5
  lattice_subtraction/config.py,sha256=uzwKb5Zi3phHUk2ZgoiLsQdwFdN-rTiY8n02U91SObc,8426
@@ -9,9 +9,9 @@ lattice_subtraction/masks.py,sha256=HIamrACmbQDkaCV4kXhnjMDSwIig4OtQFLig9A8PMO8,
9
9
  lattice_subtraction/processing.py,sha256=tmnj5K4Z9HCQhRpJ-iMd9Bj_uTRuvDEWyUenh8MCWEM,8341
10
10
  lattice_subtraction/threshold_optimizer.py,sha256=yEsGM_zt6YjgEulEZqtRy113xOFB69aHJIETm2xSS6k,15398
11
11
  lattice_subtraction/ui.py,sha256=Sp_a-yNmBRZJxll8h9T_H5-_KsI13zGYmHcbcpVpbR8,9176
12
- lattice_subtraction/visualization.py,sha256=hWFz49NBBrS7d6ofO0VyJ6-v8Q6hPG1dijbDtecMOQs,11890
13
- lattice_sub-1.3.0.dist-info/METADATA,sha256=pKwt8TcftbZGm1gvWZGO1n3iQiI4JB3E_ix3InB-4D0,14901
14
- lattice_sub-1.3.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
15
- lattice_sub-1.3.0.dist-info/entry_points.txt,sha256=o8PzJR8kFnXlKZufoYGBIHpiosM-P4PZeKZXJjtPS6Y,61
16
- lattice_sub-1.3.0.dist-info/top_level.txt,sha256=BOuW-sm4G-fQtsWPRdeLzWn0WS8sDYVNKIMj5I3JXew,20
17
- lattice_sub-1.3.0.dist-info/RECORD,,
12
+ lattice_subtraction/visualization.py,sha256=noRhBXi_Xd1b5deBfVo0Bk0f3d2kqlf3_SQwAPJC0E0,12032
13
+ lattice_sub-1.3.1.dist-info/METADATA,sha256=qN0VzkEJyNbBe_AN5tKcUXh4VjDzaL1COQCk0W83ZiM,14901
14
+ lattice_sub-1.3.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
15
+ lattice_sub-1.3.1.dist-info/entry_points.txt,sha256=o8PzJR8kFnXlKZufoYGBIHpiosM-P4PZeKZXJjtPS6Y,61
16
+ lattice_sub-1.3.1.dist-info/top_level.txt,sha256=BOuW-sm4G-fQtsWPRdeLzWn0WS8sDYVNKIMj5I3JXew,20
17
+ lattice_sub-1.3.1.dist-info/RECORD,,
@@ -19,7 +19,7 @@ Example:
19
19
  >>> result.save("output.mrc")
20
20
  """
21
21
 
22
- __version__ = "1.3.0"
22
+ __version__ = "1.3.1"
23
23
  __author__ = "George Stephenson & Vignesh Kasinath"
24
24
 
25
25
  from .config import Config
@@ -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] = (24, 6),
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: [Original] [Subtracted] [Difference] [Threshold vs Quality]
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 (1 row, 4 columns)
170
- fig, axes = plt.subplots(1, 4, figsize=figsize)
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[2].imshow(
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[2].set_title('Difference (Removed Lattice)')
194
- axes[2].axis('off')
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[3].plot(thresholds, quality_scores, 'b-', linewidth=2, label='Quality Score')
198
- axes[3].axvline(x=optimal_threshold, color='r', linestyle='--', linewidth=2,
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[3].scatter([optimal_threshold], [optimal_quality], color='r', s=100, zorder=5)
201
- axes[3].set_xlabel('Threshold', fontsize=11)
202
- axes[3].set_ylabel('Lattice Removal Efficacy', fontsize=11)
203
- axes[3].set_title(f'Threshold Optimization\nOptimal = {optimal_threshold:.3f}')
204
- axes[3].legend(loc='best', fontsize=9)
205
- axes[3].grid(True, alpha=0.3)
206
- axes[3].set_xlim(thresholds.min(), thresholds.max())
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)