From 69c29b811c6a1a45b203e49032b205b3325f7087 Mon Sep 17 00:00:00 2001 From: Talon Chandler Date: Wed, 23 Nov 2022 16:51:14 -0800 Subject: [PATCH 1/6] Populate if preset name contain any of a list of keywords --- recOrder/plugin/main_widget.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/recOrder/plugin/main_widget.py b/recOrder/plugin/main_widget.py index 1a7f694f..534a44d4 100644 --- a/recOrder/plugin/main_widget.py +++ b/recOrder/plugin/main_widget.py @@ -896,11 +896,13 @@ def connect_to_mm(self): ) config_group_found = True self.ui.cb_config_group.addItem(group) - # not entirely sure what this part does, but I left it in - # I think it tried to find a channel such as 'BF' + + # Populate the BF channel list with presets that contain any of these keywords + bf_keywords = ["BF", "bf", "Bf", "Brightfield", "brightfield"] for ch in config_list: - if ch not in self.calib_channels: + if any([keyword in ch for keyword in bf_keywords]): self.ui.cb_acq_channel.addItem(ch) + if not config_group_found: msg = ( f"No config group contains channels {self.calib_channels}. " From 52e9b0463019848e9c0ac7c1666a477911e652f0 Mon Sep 17 00:00:00 2001 From: Talon Chandler Date: Wed, 23 Nov 2022 17:00:30 -0800 Subject: [PATCH 2/6] Better keywords; insensitive to case --- recOrder/plugin/main_widget.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recOrder/plugin/main_widget.py b/recOrder/plugin/main_widget.py index 534a44d4..dc117f55 100644 --- a/recOrder/plugin/main_widget.py +++ b/recOrder/plugin/main_widget.py @@ -898,9 +898,9 @@ def connect_to_mm(self): self.ui.cb_config_group.addItem(group) # Populate the BF channel list with presets that contain any of these keywords - bf_keywords = ["BF", "bf", "Bf", "Brightfield", "brightfield"] + bf_keywords = ["bf", "brightfield", "bright", "labelfree", "label-free", "lf", "label", ] for ch in config_list: - if any([keyword in ch for keyword in bf_keywords]): + if any([keyword.lower() in ch.lower() for keyword in bf_keywords]): self.ui.cb_acq_channel.addItem(ch) if not config_group_found: From 57be9d1869076805066689f43118ae422216321c Mon Sep 17 00:00:00 2001 From: Talon Chandler Date: Wed, 23 Nov 2022 17:09:12 -0800 Subject: [PATCH 3/6] Better comment --- recOrder/plugin/main_widget.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recOrder/plugin/main_widget.py b/recOrder/plugin/main_widget.py index dc117f55..9f9c6a7b 100644 --- a/recOrder/plugin/main_widget.py +++ b/recOrder/plugin/main_widget.py @@ -898,6 +898,7 @@ def connect_to_mm(self): self.ui.cb_config_group.addItem(group) # Populate the BF channel list with presets that contain any of these keywords + # Populate the acquisition "BF channel" list with presets that contain any of these keywords bf_keywords = ["bf", "brightfield", "bright", "labelfree", "label-free", "lf", "label", ] for ch in config_list: if any([keyword.lower() in ch.lower() for keyword in bf_keywords]): From d893c5604a090f0eed74da9d2c8c3765ef5cb3b2 Mon Sep 17 00:00:00 2001 From: Talon Chandler Date: Wed, 23 Nov 2022 17:12:52 -0800 Subject: [PATCH 4/6] Typos --- recOrder/plugin/main_widget.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recOrder/plugin/main_widget.py b/recOrder/plugin/main_widget.py index 9f9c6a7b..0982f703 100644 --- a/recOrder/plugin/main_widget.py +++ b/recOrder/plugin/main_widget.py @@ -897,9 +897,8 @@ def connect_to_mm(self): config_group_found = True self.ui.cb_config_group.addItem(group) - # Populate the BF channel list with presets that contain any of these keywords # Populate the acquisition "BF channel" list with presets that contain any of these keywords - bf_keywords = ["bf", "brightfield", "bright", "labelfree", "label-free", "lf", "label", ] + bf_keywords = ["bf", "brightfield", "bright", "labelfree", "label-free", "lf", "label"] for ch in config_list: if any([keyword.lower() in ch.lower() for keyword in bf_keywords]): self.ui.cb_acq_channel.addItem(ch) From 02382254719cb077b48bc1709098b4d80896716b Mon Sep 17 00:00:00 2001 From: Talon Chandler Date: Wed, 23 Nov 2022 17:23:51 -0800 Subject: [PATCH 5/6] docs --- docs/microscope-installation-guide.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/microscope-installation-guide.md b/docs/microscope-installation-guide.md index 11c4d373..3a713616 100644 --- a/docs/microscope-installation-guide.md +++ b/docs/microscope-installation-guide.md @@ -54,9 +54,17 @@ Add 5 presets to this group named `State0`, `State1`, `State2`, `State3`, and `S ![](https://github.com/mehta-lab/recOrder/blob/main/docs/images/create_preset.png) +### (Optional) Enable "Phase From BF" acquisition + +If you would like to reconstruct phase from brightfield, add a `Micromanager` preset with brightfield properties (e.g. moving the polarization analyzer out the light path) and give the preset a name that contains one of the following case-insensitive keywords: + +`["bf", "brightfield", "bright", "labelfree", "label-free", "lf", "label"]` + +In `recOrder` you can select this preset using the `Acquisition Settings > BF Channel` dropdown menu. + ### Enable port access -Finally, enable port access so that micromanager can communicate with recOrder through the `pycromanager` bridge. To do so open MM and navigate to `Tools > Options` and check the box that says `Run server on port 4827` +Finally, enable port access so that `Micromanager` can communicate with recOrder through the `pycromanager` bridge. To do so open `Micromanager` and navigate to `Tools > Options` and check the box that says `Run server on port 4827` ![](https://github.com/mehta-lab/recOrder/blob/main/docs/images/run_port.png) From f0f7791655583dfbc5208635c35cc24ae976fd14 Mon Sep 17 00:00:00 2001 From: Talon Chandler Date: Mon, 28 Nov 2022 17:31:54 -0800 Subject: [PATCH 6/6] Add "phase" and "ph" as keywords --- docs/microscope-installation-guide.md | 2 +- recOrder/plugin/main_widget.py | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/microscope-installation-guide.md b/docs/microscope-installation-guide.md index 3a713616..c5b07e7c 100644 --- a/docs/microscope-installation-guide.md +++ b/docs/microscope-installation-guide.md @@ -58,7 +58,7 @@ Add 5 presets to this group named `State0`, `State1`, `State2`, `State3`, and `S If you would like to reconstruct phase from brightfield, add a `Micromanager` preset with brightfield properties (e.g. moving the polarization analyzer out the light path) and give the preset a name that contains one of the following case-insensitive keywords: -`["bf", "brightfield", "bright", "labelfree", "label-free", "lf", "label"]` +`["bf", "brightfield", "bright", "labelfree", "label-free", "lf", "label", "phase, "ph"]` In `recOrder` you can select this preset using the `Acquisition Settings > BF Channel` dropdown menu. diff --git a/recOrder/plugin/main_widget.py b/recOrder/plugin/main_widget.py index 0982f703..54c2ec9f 100644 --- a/recOrder/plugin/main_widget.py +++ b/recOrder/plugin/main_widget.py @@ -136,7 +136,9 @@ def __init__(self, napari_viewer: Viewer): ) # This parameter seems to be wired differently than others...investigate later - self.ui.le_recon_wavelength.editingFinished.connect(self.enter_recon_wavelength) + self.ui.le_recon_wavelength.editingFinished.connect( + self.enter_recon_wavelength + ) self.ui.le_recon_wavelength.setText("532") self.enter_recon_wavelength() @@ -898,9 +900,21 @@ def connect_to_mm(self): self.ui.cb_config_group.addItem(group) # Populate the acquisition "BF channel" list with presets that contain any of these keywords - bf_keywords = ["bf", "brightfield", "bright", "labelfree", "label-free", "lf", "label"] + bf_keywords = [ + "bf", + "brightfield", + "bright", + "labelfree", + "label-free", + "lf", + "label", + "phase", + "ph", + ] for ch in config_list: - if any([keyword.lower() in ch.lower() for keyword in bf_keywords]): + if any( + [keyword.lower() in ch.lower() for keyword in bf_keywords] + ): self.ui.cb_acq_channel.addItem(ch) if not config_group_found: