mehta-lab / waveorder

Wave optical models and inverse algorithms for label-agnostic imaging of density & orientation.
BSD 3-Clause "New" or "Revised" License
15 stars 4 forks source link

fix bug finding focus in stack with only one slice #162

Closed ieivanov closed 6 months ago

ieivanov commented 6 months ago

Fixing bug related to focus finding in stack with only one slice. in_focus_index=0 should be returned by focus_from_transverse_band, not _check_focus_inputs. _check_focus_inputs could also be refactored into two functions that 1. check the inputs and 2. determine the correct optimization function. This will remove possible confusion on _check_focus_inputs returning a callable.

talonchandler commented 6 months ago

Thanks for catching and fixing, @ieivanov. I followed your refactoring suggestion, and I moved the single-slice check to the top level so that it can return 0 directly.

ieivanov commented 6 months ago

Looks good! Merging.