microlive 1.0.17__tar.gz → 1.0.18__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.
- {microlive-1.0.17 → microlive-1.0.18}/.gitignore +1 -0
- {microlive-1.0.17 → microlive-1.0.18}/PKG-INFO +1 -1
- {microlive-1.0.17 → microlive-1.0.18}/microlive/__init__.py +1 -1
- {microlive-1.0.17 → microlive-1.0.18}/microlive/gui/app.py +50 -15
- {microlive-1.0.17 → microlive-1.0.18}/microlive/pipelines/pipeline_FRAP.py +2 -2
- {microlive-1.0.17 → microlive-1.0.18}/LICENSE +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/README.md +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/data/__init__.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/data/icons/__init__.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/data/icons/icon_micro.png +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/data/models/__init__.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/data/models/spot_detection_cnn.pth +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/gui/__init__.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/gui/main.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/gui/micro_mac.command +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/gui/micro_windows.bat +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/imports.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/microscopy.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/ml_spot_detection.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/pipelines/__init__.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/pipelines/pipeline_folding_efficiency.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/pipelines/pipeline_particle_tracking.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/pipelines/pipeline_spot_detection_no_tracking.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/utils/__init__.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/utils/device.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/utils/model_downloader.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/microlive/utils/resources.py +0 -0
- {microlive-1.0.17 → microlive-1.0.18}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microlive
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.18
|
|
4
4
|
Summary: Live-cell microscopy image analysis and single-molecule measurements
|
|
5
5
|
Project-URL: Homepage, https://github.com/ningzhaoAnschutz/microlive
|
|
6
6
|
Project-URL: Documentation, https://github.com/ningzhaoAnschutz/microlive/blob/main/docs/user_guide.md
|
|
@@ -23,7 +23,7 @@ Authors:
|
|
|
23
23
|
Nathan L. Nowling, Brian Munsky, Ning Zhao
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
|
-
__version__ = "1.0.
|
|
26
|
+
__version__ = "1.0.18"
|
|
27
27
|
__author__ = "Luis U. Aguilera, William S. Raymond, Rhiannon M. Sears, Nathan L. Nowling, Brian Munsky, Ning Zhao"
|
|
28
28
|
|
|
29
29
|
# Package name (for backward compatibility)
|
|
@@ -10710,7 +10710,7 @@ class GUI(QMainWindow):
|
|
|
10710
10710
|
}
|
|
10711
10711
|
|
|
10712
10712
|
if display_crop is not None and display_flags is not None:
|
|
10713
|
-
self.display_colocalization_results(display_crop, crop_size, display_flags, ch1, ch2)
|
|
10713
|
+
self.display_colocalization_results(display_crop, crop_size, display_flags, ch1, ch2, auto_columns=True)
|
|
10714
10714
|
self.extract_colocalization_data(save_df=False)
|
|
10715
10715
|
|
|
10716
10716
|
def _compute_coloc_flags(self, mean_crop, crop_size, ch2, method, threshold):
|
|
@@ -10795,20 +10795,34 @@ class GUI(QMainWindow):
|
|
|
10795
10795
|
|
|
10796
10796
|
|
|
10797
10797
|
|
|
10798
|
-
def display_colocalization_results(self, mean_crop, crop_size, flag_vector, ch1, ch2):
|
|
10799
|
-
"""Display the colocalization result using provided crop data.
|
|
10798
|
+
def display_colocalization_results(self, mean_crop, crop_size, flag_vector, ch1, ch2, auto_columns=False):
|
|
10799
|
+
"""Display the colocalization result using provided crop data.
|
|
10800
|
+
|
|
10801
|
+
Args:
|
|
10802
|
+
mean_crop: Cropped spot images
|
|
10803
|
+
crop_size: Size of each crop
|
|
10804
|
+
flag_vector: Boolean vector indicating colocalization status
|
|
10805
|
+
ch1: Reference channel index
|
|
10806
|
+
ch2: Colocalize channel index
|
|
10807
|
+
auto_columns: If True, auto-calculate optimal columns and update spinbox.
|
|
10808
|
+
If False (default), use current spinbox value.
|
|
10809
|
+
"""
|
|
10800
10810
|
self.figure_colocalization.clear()
|
|
10801
10811
|
title = f"Colocalization: {self.colocalization_results['colocalization_percentage']:.2f}%"
|
|
10802
10812
|
|
|
10803
|
-
#
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
self
|
|
10810
|
-
|
|
10811
|
-
|
|
10813
|
+
# Determine number of columns to use
|
|
10814
|
+
if auto_columns:
|
|
10815
|
+
# Auto-calculate optimal number of columns based on spot count
|
|
10816
|
+
n_spots = len(flag_vector) if flag_vector is not None else 0
|
|
10817
|
+
num_cols = self._calculate_optimal_coloc_columns(n_spots)
|
|
10818
|
+
# Update the spinbox to reflect the auto-calculated value
|
|
10819
|
+
if hasattr(self, 'columns_spinbox'):
|
|
10820
|
+
self.columns_spinbox.blockSignals(True)
|
|
10821
|
+
self.columns_spinbox.setValue(num_cols)
|
|
10822
|
+
self.columns_spinbox.blockSignals(False)
|
|
10823
|
+
else:
|
|
10824
|
+
# Use user's current spinbox value
|
|
10825
|
+
num_cols = self.columns_spinbox.value() if hasattr(self, 'columns_spinbox') else 20
|
|
10812
10826
|
|
|
10813
10827
|
self.plots.plot_matrix_pair_crops(
|
|
10814
10828
|
mean_crop=mean_crop,
|
|
@@ -10817,7 +10831,7 @@ class GUI(QMainWindow):
|
|
|
10817
10831
|
selected_channels=(ch1, ch2),
|
|
10818
10832
|
figure=self.figure_colocalization,
|
|
10819
10833
|
crop_spacing=5,
|
|
10820
|
-
number_columns=
|
|
10834
|
+
number_columns=num_cols,
|
|
10821
10835
|
plot_title=title
|
|
10822
10836
|
)
|
|
10823
10837
|
try:
|
|
@@ -10864,6 +10878,26 @@ class GUI(QMainWindow):
|
|
|
10864
10878
|
optimal = min(200, 120 + int((n_spots - 5000) * 80 / 10000))
|
|
10865
10879
|
|
|
10866
10880
|
return optimal
|
|
10881
|
+
|
|
10882
|
+
def _on_coloc_columns_changed(self, value):
|
|
10883
|
+
"""Handle user change to the Crop Columns spinbox.
|
|
10884
|
+
|
|
10885
|
+
Redraws the colocalization display with the new column count.
|
|
10886
|
+
Only triggers if colocalization results exist.
|
|
10887
|
+
"""
|
|
10888
|
+
if not self.colocalization_results:
|
|
10889
|
+
return
|
|
10890
|
+
|
|
10891
|
+
# Redraw with user's selected column count (auto_columns=False by default)
|
|
10892
|
+
self.display_colocalization_results(
|
|
10893
|
+
self.colocalization_results['mean_crop_filtered'],
|
|
10894
|
+
self.colocalization_results['crop_size'],
|
|
10895
|
+
self.colocalization_results['flag_vector'],
|
|
10896
|
+
self.colocalization_results['ch1_index'],
|
|
10897
|
+
self.colocalization_results['ch2_index'],
|
|
10898
|
+
auto_columns=False
|
|
10899
|
+
)
|
|
10900
|
+
self.canvas_colocalization.draw()
|
|
10867
10901
|
|
|
10868
10902
|
|
|
10869
10903
|
# Note: display_colocalization_manual() removed - replaced by separate
|
|
@@ -11395,8 +11429,9 @@ class GUI(QMainWindow):
|
|
|
11395
11429
|
columnsLayout.addWidget(QLabel("Columns:"))
|
|
11396
11430
|
self.columns_spinbox = QSpinBox()
|
|
11397
11431
|
self.columns_spinbox.setRange(4, 200)
|
|
11398
|
-
self.columns_spinbox.setValue(20) # Auto-adjusted
|
|
11399
|
-
self.columns_spinbox.setToolTip("
|
|
11432
|
+
self.columns_spinbox.setValue(20) # Auto-adjusted on first run, then user-controlled
|
|
11433
|
+
self.columns_spinbox.setToolTip("Adjust number of columns in crop display. Auto-set on first run.")
|
|
11434
|
+
self.columns_spinbox.valueChanged.connect(self._on_coloc_columns_changed)
|
|
11400
11435
|
columnsLayout.addWidget(self.columns_spinbox)
|
|
11401
11436
|
top_layout.addWidget(columnsGroup)
|
|
11402
11437
|
actionsGroup = QGroupBox("Actions")
|
|
@@ -482,7 +482,7 @@ def segment_image(image_TXY, step_size=5, pretrained_model_segmentation='auto',
|
|
|
482
482
|
|
|
483
483
|
|
|
484
484
|
|
|
485
|
-
def create_image_arrays(list_concatenated_images, selected_image=0, FRAP_channel_to_quantify=0,pretrained_model_segmentation='auto',frap_time=None, starting_changing_frame=40, step_size_increase=5,min_diameter=10):
|
|
485
|
+
def create_image_arrays(list_concatenated_images, selected_image=0, FRAP_channel_to_quantify=0,pretrained_model_segmentation='auto',frap_time=None, starting_changing_frame=40, step_size_increase=5,min_diameter=10, segmentation_step_size=5):
|
|
486
486
|
image_TZXYC = list_concatenated_images[selected_image] # shape (T Z Y X C)
|
|
487
487
|
print('Image with shape (T Z Y X C):\n ' ,list_concatenated_images[selected_image].shape) # TZYXC
|
|
488
488
|
print('Original Image pixel ', 'min: {:.2f}, max: {:.2f}, mean: {:.2f}, std: {:.2f}'.format(np.min(image_TZXYC), np.max(image_TZXYC), np.mean(image_TZXYC), np.std(image_TZXYC)) )
|
|
@@ -499,7 +499,7 @@ def create_image_arrays(list_concatenated_images, selected_image=0, FRAP_channel
|
|
|
499
499
|
image_TXY_stable_FRAP = image_TZXYC[:,0,:,:,stable_FRAP_channel] # shape (T X Y)
|
|
500
500
|
image_TXY_stable_FRAP_8bit = (image_TXY_stable_FRAP - np.min(image_TXY_stable_FRAP)) / (np.max(image_TXY_stable_FRAP) - np.min(image_TXY_stable_FRAP)) * 255
|
|
501
501
|
|
|
502
|
-
masks_TXY, background_mask, pseudo_cytosol_masks_TXY = segment_image(image_TXY_stable_FRAP_8bit, step_size=
|
|
502
|
+
masks_TXY, background_mask, pseudo_cytosol_masks_TXY = segment_image(image_TXY_stable_FRAP_8bit, step_size=segmentation_step_size, pretrained_model_segmentation=pretrained_model_segmentation,frap_time=frap_time,stable_FRAP_channel=FRAP_channel_to_quantify,min_diameter=min_diameter)
|
|
503
503
|
|
|
504
504
|
if masks_TXY is None:
|
|
505
505
|
return None, None, None, None, None, None, None
|
|
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
|
{microlive-1.0.17 → microlive-1.0.18}/microlive/pipelines/pipeline_spot_detection_no_tracking.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|