-
Notifications
You must be signed in to change notification settings - Fork 27
allow stack settings to be per-series #902
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,11 +192,14 @@ def __init__(self, taskList, startFrame, dwellTime, metadataEntries=[], prefligh | |
| self.slice_order = slice_order | ||
|
|
||
| self.require_camera_restart = require_camera_restart | ||
|
|
||
| def Init(self, spooler): | ||
| self.zPoss = np.arange(scope.stackSettings.GetStartPos(), | ||
| scope.stackSettings.GetEndPos() + .95 * scope.stackSettings.GetStepSize(), | ||
| scope.stackSettings.GetStepSize() * scope.stackSettings.GetDirection()) | ||
|
|
||
| def set_stack_positions(self, stack_mdh=None): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a) see PR #799 for re-factored A dedicated object/handler is needed as some of the properties are computed rather than directly read, depending on stack mode (hard ends, or middle & number). It makes sense that the logic for computing these is in one place and not duplicated. Notably, this code will probably not do what you want as the default mode is middle & number. Protocol then uses it's own a) having this as a separate function (rather than in |
||
| stack_mdh = dict() if stack_mdh is None else stack_mdh | ||
| start = stack_mdh.get('StackSettings.StartPos', scope.stackSettings.GetStartPos()) | ||
| stop = stack_mdh.get('StackSettings.EndPos', scope.stackSettings.GetEndPos()) | ||
| direction = 1 if stop > start else -1 | ||
| step = direction * stack_mdh.get('StackSettings.StepSize', scope.stackSettings.GetStepSize()) | ||
| self.zPoss = np.arange(start, stop + .95 * step, step) | ||
|
|
||
| if self.slice_order != 'saw': | ||
| if self.slice_order == 'random': | ||
|
|
@@ -208,9 +211,10 @@ def Init(self, spooler): | |
| else: | ||
| # even | ||
| self.zPoss = np.concatenate([self.zPoss[::2], self.zPoss[-1::-2]]) | ||
|
|
||
| self.piezoName = 'Positioning.%s' % stack_mdh.get('StackSettings.ScanPiezo', scope.stackSettings.GetScanChannel()) | ||
|
|
||
|
|
||
| self.piezoName = 'Positioning.%s' % scope.stackSettings.GetScanChannel() | ||
| def Init(self, spooler): | ||
| self.startPos = scope.state[self.piezoName + '_target'] #FIXME - _target positions shouldn't be part of scope state | ||
| self.pos = 0 | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me rest on it for a bit, but not 100% comfortable with the re-purposing of the boolean
stackparameter. Can see arguments both ways ...