Giter VIP home page Giter VIP logo

Comments (8)

tlambert03 avatar tlambert03 commented on June 15, 2024

yeah this just came up with @fdrgsp this week. agree it needs fixing. don't have a strong opinion. do you have a preference?

from napari-micromanager.

fdrgsp avatar fdrgsp commented on June 15, 2024

can this #43 (get objectives from an objective group configuration ) be an option?

from napari-micromanager.

ianhi avatar ianhi commented on June 15, 2024

Maybe we should do 3 with a fallback of 1 where we also check for other common names.

For checking names I would propose starting with this regex:

import re
re.compile("(Nosepiece|Objective|obj)s?", re.IGNORECASE)

from napari-micromanager.

ianhi avatar ianhi commented on June 15, 2024

Oh actually it should be 1 with a fallback of 3 so that users can override the devices via a config group

from napari-micromanager.

tlambert03 avatar tlambert03 commented on June 15, 2024

Yep I'm fine with these. @fdrgsp, you could incorporate the regex checking into #43. (i.e. instead of if cfg == "Objectives": you'd do:

import re
# top of file
OBJ_PTRN = re.compile("(Nosepiece|Objective|obj)s?", re.IGNORECASE)

def _refresh_objective_options(self):
    for cfg in self._mmc.getAvailableConfigGroups():
        if OBJ_PTRN.match(cfg):
            self.objective_comboBox.clear()
            self.objective_comboBox.addItems(self._mmc.getAvailableConfigs(cfg))
            return

we could also add a hook in loadSystemConfiguration that tries to determine what the "Objective" is going to be using 1 with a fallback of 3 so we don't have to search each time

from napari-micromanager.

ianhi avatar ianhi commented on June 15, 2024

adding the fallback would then be adding a second for loop (only reachable if we didn't already return) that would look like this:

        for device in self._mmc.getLoadedDevicesOfType(pymmcore_plus.DeviceType.StateDevice):
            if OBJ_PTRN.match(device):
                ...

from napari-micromanager.

tlambert03 avatar tlambert03 commented on June 15, 2024

can this be closed?

from napari-micromanager.

ianhi avatar ianhi commented on June 15, 2024

I believe so

from napari-micromanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.