-
Notifications
You must be signed in to change notification settings - Fork 4
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
Register/Fuse buttons grayed out if one layer is not Image
#5
Comments
Hey @jo-mueller, happy to hear you're liking the plugin and thanks a lot for the feedback!
I think it's a good idea to keep only labels in the selection that are available for fusion. In addition to image layers I'd also include label layers into this as 1) this currently works as labels are simply treated as images and 2) Other than that there'd also be the option to load layers programmatically as import napari_stitcher
stitching_widget = napari_stitcher.StitcherQWidget(viewer)
viewer.window.add_dock_widget(stitching_widget)
stitching_widget.load_layers([l for l in viewer.layers if type(l) == napari.layers.image.image.Image])
Yep agreed. Would you be willing to contribute a PR for this? Happy to otherwise do it on my side of course. |
I could try myself at it :) One thing that occurred to me from looking at the code: It seems like the list of layers is iterated through in multiple places, i.e. here, here and several other places. Filtering the list of layers at every place where this iteration is done would end up a bit clunky, I think. Alternative solution: I could add a property @property
def layers(self):
return [layer for layer in self.viewer.layers if isinstance(layer, (Image, Labels)] Edit: Just realized that I only need to change it in the loading functions ^^" |
Hi napari-stitcher devs,
first off: great plugin! We played around with it a bit today on some data to be stitched and found it really easy to use. One thing that seemed a bit odd to us: When selecting some layers and clicking on the
Selection
button in the merger widget, theFuse/Register
buttons remain grayed out if one of the selected layers is not of typeImage
(which obviously makes sense, because how would you merge, say, a points layer) - it's just that with many layers, it can be a bit hard to find which layer is the problematic one.Maybe an easy solution for this would be to build a check into the function that adds the layers to the list and only adds them if the layer is of type
Image
. Here would probably be a good place.cc @tsmejkal @zoccoler @maleehahassan
The text was updated successfully, but these errors were encountered: