Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: HCS Wizard Widget with useq WellPlatePlan #308

Closed
wants to merge 95 commits into from
Closed
Show file tree
Hide file tree
Changes from 79 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
b11e305
feat: add tensorstore
fdrgsp May 27, 2024
d71f5e3
test: update
fdrgsp May 27, 2024
ff09512
feat: add HCSWizard + test
fdrgsp Jun 3, 2024
70cc23b
feat: temp examples
fdrgsp Jun 3, 2024
2a30421
fix: use pydantic
fdrgsp Jun 3, 2024
c6f65b5
test: update
fdrgsp Jun 3, 2024
b14286d
test: update
fdrgsp Jun 3, 2024
3616612
test: update
fdrgsp Jun 3, 2024
3d41c08
fix: example
fdrgsp Jun 3, 2024
a9e5276
fix: HCSWizard docstring
fdrgsp Jun 3, 2024
0a7c15b
docs: add docs
fdrgsp Jun 3, 2024
0f9e8e1
Merge remote-tracking branch 'upstream/main' into hcs_wizard
fdrgsp Jun 3, 2024
e068240
fix: fix pyproject.toml
fdrgsp Jun 5, 2024
f55c216
fix: fix pyproject.toml
fdrgsp Jun 5, 2024
0691305
fix: fix pyproject.toml
fdrgsp Jun 5, 2024
cdfc926
Merge branch 'main' into add_tensorstore
fdrgsp Jun 5, 2024
f47e696
fix: DIRECTORY_WRITERS
fdrgsp Jun 5, 2024
52ed1d2
test: fix
fdrgsp Jun 5, 2024
f2d2edc
fix: pre-commit
fdrgsp Jun 6, 2024
b75db5a
feat: create workers
fdrgsp Jun 6, 2024
4bd7a5e
fix: pyproject
fdrgsp Jun 6, 2024
ca36c5a
test: add test
fdrgsp Jun 6, 2024
b92a84b
fix: pyproject allow-direct-references
fdrgsp Jun 6, 2024
92b81ab
fix: pyproject
fdrgsp Jun 6, 2024
43f8037
fix: _create_writer
fdrgsp Jun 6, 2024
04d50cd
Merge branch 'add_tensorstore' into hcs_wizard
fdrgsp Jun 6, 2024
f0992df
fix: handle positions
fdrgsp Jun 6, 2024
cfea28c
fix: update pymmcore-plus version
fdrgsp Jun 10, 2024
94d6944
Merge remote-tracking branch 'upstream/main' into hcs_wizard
fdrgsp Jun 13, 2024
f027bd4
Merge branch 'main' into hcs_wizard
fdrgsp Jun 25, 2024
d45be48
feat: start update with useq
fdrgsp Jul 4, 2024
f60e762
fix: revert
fdrgsp Jul 4, 2024
3449ca6
fix: revert
fdrgsp Jul 4, 2024
52e48d8
fix: revert
fdrgsp Jul 4, 2024
52399f4
fix: revert
fdrgsp Jul 4, 2024
7f12c18
fix: valueChanged
fdrgsp Jul 4, 2024
d592925
fix: revert
fdrgsp Jul 4, 2024
7049dd7
fix: remove example
fdrgsp Jul 4, 2024
3a92d2c
fix: fix load database
fdrgsp Jul 4, 2024
d71d4d8
fix: fix example
fdrgsp Jul 4, 2024
64d7491
fix: QApplication
fdrgsp Jul 4, 2024
9002480
fix: temp update pyproject.toml
fdrgsp Jul 4, 2024
791828b
fix: _init_widget
fdrgsp Jul 4, 2024
d8f8152
fix: Update pyproject.toml
fdrgsp Jul 4, 2024
b39a46e
fix: Update src/pymmcore_widgets/_stage_widget.py
fdrgsp Jul 4, 2024
c72e55b
feat: merge
fdrgsp Jul 4, 2024
e009cbc
fix: fix examples
fdrgsp Jul 4, 2024
8e7e6c7
fix: fix examples
fdrgsp Jul 5, 2024
a49ccad
fix: remove database
fdrgsp Jul 5, 2024
ff7a491
fix: valueChanged
fdrgsp Jul 5, 2024
2678a92
fix: pydantc
fdrgsp Jul 5, 2024
a25c4d3
fix: model_validate
fdrgsp Jul 5, 2024
720d690
fix: for 3.8
fdrgsp Jul 5, 2024
8231e89
style(pre-commit.ci): auto fixes [...]
pre-commit-ci[bot] Jul 5, 2024
f26ef70
fix: for 3.8
fdrgsp Jul 5, 2024
be2e669
fix: remove database json
fdrgsp Jul 5, 2024
d0aca2e
style(pre-commit.ci): auto fixes [...]
pre-commit-ci[bot] Jul 5, 2024
a54d394
fix: for 3.8
fdrgsp Jul 5, 2024
dc1fb06
fix: example
fdrgsp Jul 5, 2024
34789a1
Merge branch 'main' into useq_hcs_wizard
fdrgsp Jul 5, 2024
beba5ee
fix: docs
fdrgsp Jul 5, 2024
079d4e8
test: temporary fix
fdrgsp Jul 5, 2024
9726eff
test: fix model_dump
fdrgsp Jul 5, 2024
1a38449
test: temp skip
fdrgsp Jul 5, 2024
872e6eb
Merge branch 'main' into useq_hcs_wizard
fdrgsp Jul 6, 2024
b2bf320
fix: update example + invert angle sign
fdrgsp Jul 6, 2024
1b3de7e
fix: use general Mode
fdrgsp Jul 6, 2024
7c2c653
fix: update
fdrgsp Jul 6, 2024
3c8949d
Merge branch 'useq_hcs_wizard' of https://github.com/fdrgsp/pymmcore-…
fdrgsp Jul 6, 2024
3f12df5
Merge remote-tracking branch 'upstream/main' into useq_hcs_wizard
fdrgsp Jul 6, 2024
28f34b2
fix: update modes
fdrgsp Jul 6, 2024
8d7d670
fix: do not use _KNOWN_PLATES
fdrgsp Jul 6, 2024
31e53e7
fix: comment
fdrgsp Jul 6, 2024
57026ad
fix: make private
fdrgsp Jul 6, 2024
b4b9c3c
fix: example
fdrgsp Jul 6, 2024
39f4366
fix: remove FrozenModel
fdrgsp Jul 6, 2024
5517fda
fix: use RelativePosition
fdrgsp Jul 6, 2024
69586bc
Merge branch 'main' into useq_hcs_wizard
fdrgsp Jul 6, 2024
ec6f61d
fix: use RelativePosition
fdrgsp Jul 6, 2024
67f3e15
fix: ZeroDivisionError
fdrgsp Jul 6, 2024
d57f6ad
fix: _PlateSelectorWidget layout
fdrgsp Jul 6, 2024
23782b4
fix: Modes + layout
fdrgsp Jul 6, 2024
af35568
fix: remove unused
fdrgsp Jul 7, 2024
fd39db9
fix: refactor widgets layout
fdrgsp Jul 7, 2024
4d6a2d1
fix: remove unused
fdrgsp Jul 7, 2024
63bc51c
fix: update util
fdrgsp Jul 7, 2024
5acaf31
fix: comment
fdrgsp Jul 7, 2024
77fd225
fix: import
fdrgsp Jul 7, 2024
3815602
fix useq imports
tlambert03 Jul 7, 2024
a2e4add
Merge remote-tracking branch 'upstream/main' into useq_hcs_wizard
fdrgsp Jul 7, 2024
b1d042d
fix: shape
fdrgsp Jul 7, 2024
9db3c63
test: fix
fdrgsp Jul 7, 2024
a09d93e
Merge remote-tracking branch 'upstream/main' into useq_hcs_wizard
fdrgsp Jul 7, 2024
70885a8
Merge remote-tracking branch 'upstream/main' into useq_hcs_wizard
fdrgsp Jul 11, 2024
fd2c324
Merge remote-tracking branch 'upstream/main' into useq_hcs_wizard
fdrgsp Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/widget_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"TimePlanWidget",
"ZPlanWidget",
"GridPlanWidget",
"MDASequenceWidget"
"MDASequenceWidget",
"HCSWizard"
],
"camera_widgets": [
"CameraRoiWidget",
Expand Down
38 changes: 38 additions & 0 deletions examples/hcs_temp/calibration_circle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from contextlib import suppress

from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication
from useq import WellPlate

from pymmcore_widgets.hcs._calibration_widget._calibration_widget import (
_CalibrationData,
_PlateCalibrationWidget,
)

with suppress(ImportError):
from rich import print


plate = WellPlate(rows=8, columns=12, well_spacing=(9, 9), well_size=(6.4, 6.4))

app = QApplication([])

mmc = CMMCorePlus.instance()
mmc.loadSystemConfiguration()

cb = _PlateCalibrationWidget(mmcore=mmc)

cb.setValue(
_CalibrationData(
plate=plate,
calibration_positions_a1=[(-10, 0), (0, 10), (10, 0)],
calibration_positions_an=[(90, 0), (100, 10), (110, 0)],
)
)
cb._calibration_mode._mode_combo.setCurrentIndex(1)

cb.valueChanged.connect(print)

cb.show()

app.exec()
37 changes: 37 additions & 0 deletions examples/hcs_temp/calibration_rectangle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from contextlib import suppress

from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication
from useq import WellPlate

from pymmcore_widgets.hcs._calibration_widget._calibration_widget import (
_CalibrationData,
_PlateCalibrationWidget,
)

with suppress(ImportError):
from rich import print


plate = WellPlate(
rows=1, columns=1, well_spacing=(0, 0), well_size=(22, 22), circular_wells=False
)

app = QApplication([])

mmc = CMMCorePlus.instance()
mmc.loadSystemConfiguration()

cb = _PlateCalibrationWidget(mmcore=mmc)

cb.setValue(
_CalibrationData(
plate=plate,
calibration_positions_a1=[(-100, 100), (100, -100)],
)
)
cb.show()

cb.valueChanged.connect(print)

app.exec()
23 changes: 23 additions & 0 deletions examples/hcs_temp/fov_selector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from contextlib import suppress

with suppress(ImportError):
pass

from qtpy.QtWidgets import QApplication
from useq import WellPlate

from pymmcore_widgets.hcs._fov_widget._fov_sub_widgets import Center
from pymmcore_widgets.hcs._fov_widget._fov_widget import _FOVSelectorWidget

app = QApplication([])

plate = WellPlate(rows=8, columns=12, well_spacing=(9, 9), well_size=(6.4, 6.4))
fs = _FOVSelectorWidget(
plate=plate, mode=Center(x=0, y=0, fov_width=512, fov_height=512)
)

fs.valueChanged.connect(print)

fs.show()

app.exec()
18 changes: 18 additions & 0 deletions examples/hcs_temp/plate_selector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from contextlib import suppress

with suppress(ImportError):
from rich import print

from qtpy.QtWidgets import QApplication

from pymmcore_widgets.hcs._plate_widget import _PlateSelectorWidget

app = QApplication([])

ps = _PlateSelectorWidget()

ps.valueChanged.connect(print)

ps.show()

app.exec()
52 changes: 52 additions & 0 deletions examples/hcs_wizard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from contextlib import suppress

from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication

with suppress(ImportError):
from rich import print

from useq import GridRowsColumns, WellPlate, WellPlatePlan

from pymmcore_widgets.hcs import HCSWizard

app = QApplication([])
mmc = CMMCorePlus.instance()
mmc.loadSystemConfiguration()
w = HCSWizard()

fov_width = mmc.getImageWidth() * mmc.getPixelSizeUm()
fov_height = mmc.getImageHeight() * mmc.getPixelSizeUm()

plate = WellPlate(
rows=8, columns=12, well_spacing=(9, 9), well_size=(6.4, 6.4), name="96-well"
)
wpp = WellPlatePlan(
plate=plate,
a1_center_xy=(0, 0),
rotation=3,
selected_wells=(slice(1, 7), slice(1, 11)),
well_points_plan=GridRowsColumns(
rows=3, columns=3, fov_width=fov_width, fov_height=fov_height, overlap=-100
),
)
w.setValue(wpp)

w.valueChanged.connect(print)


# override the accept method to show the plot
def _accept():
value = w.value()
print(value)
# execute only if matplotlib is available
with suppress(ImportError):
if value is None:
return
print(value.plot())


w.accept = _accept

w.show()
app.exec()
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ dependencies = [
'pymmcore-plus[cli] >=0.11.0',
'qtpy >=2.0',
'superqt[quantity] >=0.5.3',
'useq-schema >=0.4.7',
'useq-schema @ git+https://github.com/pymmcore-plus/useq-schema.git', # temporary until new useq release
]

[tool.hatch.metadata]
allow-direct-references = true

# extras
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
[project.optional-dependencies]
Expand Down Expand Up @@ -174,4 +177,5 @@ ignore = [
]

[tool.typos.default]
extend-ignore-identifiers-re = ["(?i)ome"]
extend-ignore-identifiers-re = ["(?i)nd2?.*", "(?i)ome", "FO(Vs?)?"]

2 changes: 2 additions & 0 deletions src/pymmcore_widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from ._shutter_widget import ShuttersWidget
from ._snap_button_widget import SnapButton
from ._stage_widget import StageWidget
from .hcs import HCSWizard
from .hcwizard import ConfigWizard
from .mda import MDAWidget
from .useq_widgets import (
Expand Down Expand Up @@ -78,6 +79,7 @@ def __getattr__(name: str) -> object:
"ExposureWidget",
"GridPlanWidget",
"GroupPresetTableWidget",
"HCSWizard",
"ImagePreview",
"InstallWidget",
"LiveButton",
Expand Down
5 changes: 5 additions & 0 deletions src/pymmcore_widgets/hcs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""HCS Wizard."""

from ._main_wizard._main_wizard import HCSWizard

__all__ = ["HCSWizard"]
Loading