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

GridPlan problems #149

Closed
wl-stepp opened this issue Nov 29, 2023 · 7 comments
Closed

GridPlan problems #149

wl-stepp opened this issue Nov 29, 2023 · 7 comments

Comments

@wl-stepp
Copy link
Contributor

useq-schema 0.4.7

I think the sequence setup in the documentation does not work anymore:

>>> from useq import MDASequence, Position, Channel, TIntervalDuration
>>> seq = MDASequence(
...     time_plan={"interval": 0.1, "loops": 2},
...     stage_positions=[(1, 1, 1)],
...     grid_plan={"rows": 2, "cols": 2},
...     z_plan={"range": 3, "step": 1},
...     channels=[{"config": "DAPI", "exposure": 1}]
... )

Works for me if I put "columns" instead of "cols".

Another small problem I see is for this sequence:

>>> seq = MDASequence(axis_order="gtc",time_plan={"interval": 1, "loops": 2},channels=[{"config": "DAPI", "exposure": 1}],grid_plan={"rows": 2, "columns": 2})
>>> for event in seq:
...    print(event)
...
index=mappingproxy({'t': 0, 'g': 0, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=0.0 x_pos=-0.5 y_pos=0.5
index=mappingproxy({'t': 1, 'g': 0, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=1.0 x_pos=-0.5 y_pos=0.5
index=mappingproxy({'t': 0, 'g': 1, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=0.0 x_pos=0.5 y_pos=0.5
index=mappingproxy({'t': 1, 'g': 1, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=1.0 x_pos=0.5 y_pos=0.5
index=mappingproxy({'t': 0, 'g': 2, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=0.0 x_pos=0.5 y_pos=-0.5
index=mappingproxy({'t': 1, 'g': 2, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=1.0 x_pos=0.5 y_pos=-0.5
index=mappingproxy({'t': 0, 'g': 3, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=0.0 x_pos=-0.5 y_pos=-0.5
index=mappingproxy({'t': 1, 'g': 3, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=1.0 x_pos=-0.5 y_pos=-0.5

Might no be a very typical setup with axis order "gtc, but note how the min_start_time resets for every g index. This leads to the first time series at position 0 respecting the interval, while all later positions are acquired at max speed.

@wl-stepp
Copy link
Contributor Author

For overlaps, I don't think those are implemented yet, correct?

>>> seq = MDASequence(grid_plan={"rows": 2, "columns": 2, "overlap": (0.2, 0.2)})
>>> for event in seq:
...     print(event)
... 
index=mappingproxy({'g': 0}) x_pos=-0.499 y_pos=0.499
index=mappingproxy({'g': 1}) x_pos=0.499 y_pos=0.499
index=mappingproxy({'g': 2}) x_pos=0.499 y_pos=-0.499
index=mappingproxy({'g': 3}) x_pos=-0.499 y_pos=-0.499
>>> seq = MDASequence(grid_plan={"rows": 2, "columns": 2, "overlap": (0.1, 0.1)}) 
>>> for event in seq:
...     print(event)
... 
index=mappingproxy({'g': 0}) x_pos=-0.4995 y_pos=0.4995
index=mappingproxy({'g': 1}) x_pos=0.4995 y_pos=0.4995
index=mappingproxy({'g': 2}) x_pos=0.4995 y_pos=-0.4995
index=mappingproxy({'g': 3}) x_pos=-0.4995 y_pos=-0.4995

x_pos and y_pos stay the same for different overlap settings. I see the same for a specific value for the fov size.

@fdrgsp
Copy link
Contributor

fdrgsp commented Nov 29, 2023

I think the sequence setup in the documentation does not work anymore

Thanks Willi, I'll fix the docs!

Another small problem I see is for this sequence

That's definitely not the intended behavior! Thanks, I'll have a look!

For overlaps, I don't think those are implemented yet, correct?

I will update the docs for that as well but the overlap is expressed in percentage so 0.1 or 0.2 won't do much. Does it make sense?

@wl-stepp
Copy link
Contributor Author

Ok, thanks. But then there is a problem in the GridPlanWidget in the useq_widgets. Because if I set 50% overlap there I get 0.5 overlap in the acquisition. Can you check that?

@wl-stepp
Copy link
Contributor Author

https://github.com/pymmcore-plus/pymmcore-widgets/blob/8135e080a2bf9cd493abde4dddf33f647abe9bb8/src/pymmcore_widgets/useq_widgets/_grid.py#L229

To be honest, for me having overlap 0 to 1 would be more intuitive. But as long as it's consistent...

@tlambert03
Copy link
Member

Yeah I kinda prefer 0-1 as well

@tlambert03
Copy link
Member

@fdrgsp is this resolved now with pymmcore-plus/pymmcore-widgets#249?

@fdrgsp
Copy link
Contributor

fdrgsp commented Feb 6, 2024

@fdrgsp is this resolved now with pymmcore-plus/pymmcore-widgets#249?

I think everything is fixed but this:

Another small problem I see is for this sequence:

>>> seq = MDASequence(axis_order="gtc",time_plan={"interval": 1, "loops": 2},channels=[{"config": "DAPI", "exposure": 1}],grid_plan={"rows": 2, "columns": 2})
>>> for event in seq:
...    print(event)
...
index=mappingproxy({'t': 0, 'g': 0, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=0.0 x_pos=-0.5 y_pos=0.5
index=mappingproxy({'t': 1, 'g': 0, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=1.0 x_pos=-0.5 y_pos=0.5
index=mappingproxy({'t': 0, 'g': 1, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=0.0 x_pos=0.5 y_pos=0.5
index=mappingproxy({'t': 1, 'g': 1, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=1.0 x_pos=0.5 y_pos=0.5
index=mappingproxy({'t': 0, 'g': 2, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=0.0 x_pos=0.5 y_pos=-0.5
index=mappingproxy({'t': 1, 'g': 2, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=1.0 x_pos=0.5 y_pos=-0.5
index=mappingproxy({'t': 0, 'g': 3, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=0.0 x_pos=-0.5 y_pos=-0.5
index=mappingproxy({'t': 1, 'g': 3, 'c': 0}) channel=Channel(config='DAPI') exposure=1.0 min_start_time=1.0 x_pos=-0.5 y_pos=-0.5

Might no be a very typical setup with axis order "gtc, but note how the min_start_time resets for every g index. This leads to the first time series at position 0 respecting the interval, while all later positions are acquired at max speed.

I will open an issue just for that and close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants