Giter VIP home page Giter VIP logo

napping's Introduction

napping

PyPI License Python Version Issues Pull requests

Control point mapping and coordinate transformation using napari

Installation

You can install napping via pip:

pip install napping

To install latest development version:

pip install git+https://github.com/BodenmillerGroup/napping.git

Usage

Run napping for control point mapping and coordinate transformation

Authors

Created and maintained by Jonas Windhager until February 2023.

Maintained by Milad Adibi from February 2023.

Contributing

Contributing

Changelog

Changelog

License

MIT

napping's People

Contributors

jwindhager avatar nilseling avatar milad4849 avatar

Stargazers

Pho Hale avatar  avatar

Watchers

James Cloos avatar Anton Rau avatar Vito Zanotelli avatar  avatar  avatar

napping's Issues

Improve input data validation

As requested by @nilseling: ensure input files (control points, images, etc) are properly validated upon loading. In particular, check whether the control points table contains the required columns and give meaningful error messages if it does not.

Switching images via the "left" and "right" buttons don't seem to work

When specifying multiple files via directories it's fine to load the first set of images (mcd and chi) and assign the control points.
Once when I want to switch to the next set of files via the "right arrow" button, I get this error:

ERROR:root:Unhandled exception:
Traceback (most recent call last):
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napping/widgets/napping_widget.py", line 37, in on_next_button_clicked
    view_controller.controller.show_next()
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napping/napping.py", line 165, in show_next
    return self._show()
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napping/napping.py", line 413, in _show
    self._target_view_controller.show(self.current_target_image_file_path)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napping/napping.py", line 507, in show
    self._close_image()
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napping/napping.py", line 569, in _close_image
    while len(self._image_layers) > 0:
TypeError: object of type 'NoneType' has no len()

ERROR:root:Unhandled exception:
Traceback (most recent call last):
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/app/backends/_qt.py", line 453, in mouseReleaseEvent
    self._vispy_mouse_release(
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/app/base.py", line 221, in _vispy_mouse_release
    ev = self._vispy_canvas.events.mouse_release(**kwargs)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 455, in __call__
    self._invoke_callback(cb, event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 473, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    cb(event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/_qt/qt_viewer.py", line 709, in on_mouse_release
    mouse_release_callbacks(layer, event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/utils/interactions.py", line 188, in mouse_release_callbacks
    next(gen)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/_points_mouse_bindings.py", line 99, in add
    layer.add(layer.coordinates)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 1687, in add
    self.data = np.append(self.data, np.atleast_2d(coord), axis=0)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 527, in data
    self.selected_data = set(np.arange(cur_npoints, len(data)))
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 1295, in selected_data
    self.current_properties = properties
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 657, in current_properties
    self.events.current_properties()
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/utils/events/event.py", line 510, in __call__
    self._invoke_callback(cb, event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/utils/events/event.py", line 527, in _invoke_callback
    _handle_exception(
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/utils/events/event.py", line 525, in _invoke_callback
    cb(event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napping/napping.py", line 585, in on_points_layer_current_properties_changed
    self._controller._handle_control_points_changed()
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napping/napping.py", line 438, in _handle_control_points_changed
    self.target_view_controller.refresh()
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napping/napping.py", line 513, in refresh
    self._widget.refresh()
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napping/widgets/napping_widget.py", line 51, in refresh
    path_name = self._view_controller.image_path.name
AttributeError: 'NoneType' object has no attribute 'name'

The next czi file loads but not the next mcd.
Cheers,

Nils

When loading mcd, the first panorama should be selected and reset to view

Hey,

  1. when loading the mcd file and a czi, python still throws the error
PluginError: Error in plugin 'builtins', hook 'napari_get_reader'
  Cause was: ValueError('Could not find a format to read the specified file in single-image mode')
    in file: /Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/imageio/core/functions.py
    at line: 181
     author: napari team
      email: [email protected]
    package: napari
        url: https://napari.org
    version: 0.4.4

I'm not fully sure from which file type this is coming since both images can be read in.

  1. For the mcd file, I think it would be good to select the first panorama by default - otherwise it can be a bit confusing to find the panorama since one needs to click the "Home" button first.

Thanks for your efforts on this!
Cheers,

Nils

Weird bug when selecting points

Hey @jwindhager

we're having this new bug: when selecting points on the images, an outline of the cross appears but the cursor is locked to the image until rapid (maybe double) clicking. Again, it's a bit hard to describe the GUI.
Here is the error message that I didn't understand:

ERROR:root:Unhandled exception:
Traceback (most recent call last):
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/numpy/lib/arraysetops.py", line 284, in unique
    consolidated = ar.view(dtype)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/numpy/core/_internal.py", line 459, in _view_is_safe
    raise TypeError("Cannot change data-type for object array.")
TypeError: Cannot change data-type for object array.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/app/backends/_qt.py", line 453, in mouseReleaseEvent
    self._vispy_mouse_release(
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/app/base.py", line 221, in _vispy_mouse_release
    ev = self._vispy_canvas.events.mouse_release(**kwargs)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 455, in __call__
    self._invoke_callback(cb, event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 473, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    cb(event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/_qt/qt_viewer.py", line 714, in on_mouse_release
    mouse_release_callbacks(layer, event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/utils/interactions.py", line 188, in mouse_release_callbacks
    next(gen)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/_points_mouse_bindings.py", line 99, in add
    layer.add(layer.coordinates)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 1687, in add
    self.data = np.append(self.data, np.atleast_2d(coord), axis=0)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 527, in data
    self.selected_data = set(np.arange(cur_npoints, len(data)))
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 1289, in selected_data
    properties = {
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 1290, in <dictcomp>
    k: np.unique(v[index], axis=0) for k, v in self.properties.items()
  File "<__array_function__ internals>", line 5, in unique
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/numpy/lib/arraysetops.py", line 295, in unique
    raise TypeError(msg.format(dt=ar.dtype)) from e
TypeError: The axis argument to unique is not supported for dtype object

Cannot change data-type for object array.

Hey,

I'm not so sure where this issue is coming from, so I'm posting it here.

ERROR:root:Unhandled exception:
Traceback (most recent call last):
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/numpy/lib/arraysetops.py", line 284, in unique
    consolidated = ar.view(dtype)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/numpy/core/_internal.py", line 459, in _view_is_safe
    raise TypeError("Cannot change data-type for object array.")
TypeError: Cannot change data-type for object array.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/app/backends/_qt.py", line 453, in mouseReleaseEvent
    self._vispy_mouse_release(
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/app/base.py", line 221, in _vispy_mouse_release
    ev = self._vispy_canvas.events.mouse_release(**kwargs)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 455, in __call__
    self._invoke_callback(cb, event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 473, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    cb(event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/_qt/qt_viewer.py", line 714, in on_mouse_release
    mouse_release_callbacks(layer, event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/utils/interactions.py", line 188, in mouse_release_callbacks
    next(gen)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/_points_mouse_bindings.py", line 99, in add
    layer.add(layer.coordinates)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 1687, in add
    self.data = np.append(self.data, np.atleast_2d(coord), axis=0)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 527, in data
    self.selected_data = set(np.arange(cur_npoints, len(data)))
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 1289, in selected_data
    properties = {
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 1290, in <dictcomp>
    k: np.unique(v[index], axis=0) for k, v in self.properties.items()
  File "<__array_function__ internals>", line 5, in unique
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/numpy/lib/arraysetops.py", line 295, in unique
    raise TypeError(msg.format(dt=ar.dtype)) from e
TypeError: The axis argument to unique is not supported for dtype object

Thaaaaaaank you!

Update dependencies

Hi team, while working on conda-forge/staged-recipes#25122, we noticed that some dependencies are directly imported in code, but these are not declared as dependencies.

  • imageio
  • pillow

Could this be updated for the next release?

Cheers! ๐Ÿš€

crashes when opening first files

Hey,

when starting immucan-roi and selecting the input folder this error directly appears:

(immucan-roi) immucan@IMLS-11J80-M01 ~ % immucan-roi                                                               
2022-01-27 16:30:01.694 python[8669:109218] -[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
2022-01-27 16:30:01.694 python[8669:109218] Exception calling directoryDidChange: on delegate <QNSOpenSavePanelDelegate: 0x7fc9935a41a0> exception=-[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
2022-01-27 16:30:01.696 python[8669:109218] -[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
2022-01-27 16:30:01.696 python[8669:109218] Exception calling directoryDidChange: on delegate <QNSOpenSavePanelDelegate: 0x7fc9935a41a0> exception=-[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
2022-01-27 16:30:02.473 python[8669:109218] -[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
2022-01-27 16:30:02.473 python[8669:109218] Exception calling directoryDidChange: on delegate <QNSOpenSavePanelDelegate: 0x7fc9935a41a0> exception=-[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
Traceback (most recent call last):
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/bin/immucan-roi", line 8, in <module>
    sys.exit(main())
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/immucan_roi/__main__.py", line 21, in main
    app.exec_dialog()
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napping/_napping_application.py", line 80, in exec_dialog
    dialog = self._create_dialog()
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/immucan_roi/_immucan_napping_application.py", line 49, in _create_dialog
    for source_img_file in dialog.source_img_path.iterdir():
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/pathlib.py", line 1160, in iterdir
    for name in self._accessor.listdir(self):
FileNotFoundError: [Errno 2] No such file or directory: '/Volumes/immucan_volume/czi'
(immucan-roi) immucan@IMLS-11J80-M01 ~ % immucan-roi
2022-01-27 16:30:09.482 python[8678:109787] -[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
2022-01-27 16:30:09.482 python[8678:109787] Exception calling directoryDidChange: on delegate <QNSOpenSavePanelDelegate: 0x7f8517d91cd0> exception=-[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
2022-01-27 16:30:09.483 python[8678:109787] -[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
2022-01-27 16:30:09.483 python[8678:109787] Exception calling directoryDidChange: on delegate <QNSOpenSavePanelDelegate: 0x7f8517d91cd0> exception=-[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
2022-01-27 16:30:10.745 python[8678:109787] -[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
2022-01-27 16:30:10.745 python[8678:109787] Exception calling directoryDidChange: on delegate <QNSOpenSavePanelDelegate: 0x7f8517d91cd0> exception=-[NSNull length]: unrecognized selector sent to instance 0x7fff88aec000
/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/_vispy/layers/image.py:242: UserWarning: data shape (33089, 38573) exceeds GL_MAX_TEXTURE_SIZE 16384 in at least one axis and will be downsampled. Rendering is currently in 2D mode.
  warnings.warn(
/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/_vispy/layers/image.py:242: UserWarning: data shape (33089, 38573) exceeds GL_MAX_TEXTURE_SIZE 16384 in at least one axis and will be downsampled. Rendering is currently in 2D mode.
  warnings.warn(
/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/_vispy/layers/image.py:242: UserWarning: data shape (33089, 38573) exceeds GL_MAX_TEXTURE_SIZE 16384 in at least one axis and will be downsampled. Rendering is currently in 2D mode.
  warnings.warn(
/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/_vispy/layers/image.py:242: UserWarning: data shape (33089, 38573) exceeds GL_MAX_TEXTURE_SIZE 16384 in at least one axis and will be downsampled. Rendering is currently in 2D mode.
  warnings.warn(
/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/_vispy/layers/image.py:242: UserWarning: data shape (33089, 38573) exceeds GL_MAX_TEXTURE_SIZE 16384 in at least one axis and will be downsampled. Rendering is currently in 2D mode.
  warnings.warn(
/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/_vispy/layers/image.py:242: UserWarning: data shape (33089, 38573) exceeds GL_MAX_TEXTURE_SIZE 16384 in at least one axis and will be downsampled. Rendering is currently in 2D mode.
  warnings.warn(
/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/_vispy/layers/image.py:242: UserWarning: data shape (33089, 38573) exceeds GL_MAX_TEXTURE_SIZE 16384 in at least one axis and will be downsampled. Rendering is currently in 2D mode.
  warnings.warn(
/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/_vispy/layers/image.py:242: UserWarning: data shape (33089, 38573) exceeds GL_MAX_TEXTURE_SIZE 16384 in at least one axis and will be downsampled. Rendering is currently in 2D mode.
  warnings.warn(
/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/_vispy/layers/image.py:242: UserWarning: data shape (33089, 38573) exceeds GL_MAX_TEXTURE_SIZE 16384 in at least one axis and will be downsampled. Rendering is currently in 2D mode.
  warnings.warn(
Traceback (most recent call last):
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/pandas/core/internals/managers.py", line 1774, in create_block_manager_from_arrays
    mgr = BlockManager(blocks, axes)
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/pandas/core/internals/managers.py", line 914, in __init__
    self._verify_integrity()
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/pandas/core/internals/managers.py", line 921, in _verify_integrity
    raise construction_error(tot_items, block.shape[1:], self.axes)
ValueError: Shape of passed values is (999, 1), indices imply (0, 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/bin/immucan-roi", line 8, in <module>
    sys.exit(main())
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/immucan_roi/__main__.py", line 21, in main
    app.exec_dialog()
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napping/_napping_application.py", line 133, in exec_dialog
    self.exec(app=app)
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napping/_napping_application.py", line 40, in exec
    self._current_source_viewer = self._create_source_viewer(
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/immucan_roi/_immucan_napping_application.py", line 59, in _create_source_viewer
    source_viewer = super(
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napping/_napping_application.py", line 234, in _create_source_viewer
    return NappingViewer(img_file)
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napping/qt/_napping_viewer.py", line 39, in __init__
    self._points_layer = self._create_points_layer()
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napping/qt/_napping_viewer.py", line 76, in _create_points_layer
    points_layer = self._viewer.add_points(**self._POINTS_LAYER_ARGS)
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/components/viewer_model.py", line 4, in add_points
    import itertools
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/layers/points/points.py", line 352, in __init__
    self._feature_table = _FeatureTable.from_layer(
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/layers/utils/layer_utils.py", line 882, in from_layer
    features = _features_from_properties(
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/layers/utils/layer_utils.py", line 941, in _features_from_properties
    return _validate_features(properties, num_data=num_data)
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/napari/layers/utils/layer_utils.py", line 916, in _validate_features
    return pd.DataFrame(data=features, index=index)
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/pandas/core/frame.py", line 614, in __init__
    mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager)
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/pandas/core/internals/construction.py", line 464, in dict_to_mgr
    return arrays_to_mgr(
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/pandas/core/internals/construction.py", line 135, in arrays_to_mgr
    return create_block_manager_from_arrays(
  File "/Users/immucan/opt/anaconda3/envs/immucan-roi/lib/python3.9/site-packages/pandas/core/internals/managers.py", line 1776, in create_block_manager_from_arrays
    raise construction_error(len(arrays), arrays[0].shape, axes, e)
ValueError: Shape of passed values is (999, 1), indices imply (0, 1)

Working on macOS Catalina 10.15.7 and immucan-roi v0.1.0. Thaaaaaaaank you :)

PermissionError when selecting points

This error occurs sometimes randomly when assigning points:

ERROR:root:Unhandled exception:
Traceback (most recent call last):
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/app/backends/_qt.py", line 453, in mouseReleaseEvent
    self._vispy_mouse_release(
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/app/base.py", line 221, in _vispy_mouse_release
    ev = self._vispy_canvas.events.mouse_release(**kwargs)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 455, in __call__
    self._invoke_callback(cb, event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 473, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    cb(event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/_qt/qt_viewer.py", line 709, in on_mouse_release
    mouse_release_callbacks(layer, event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/utils/interactions.py", line 188, in mouse_release_callbacks
    next(gen)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/_points_mouse_bindings.py", line 99, in add
    layer.add(layer.coordinates)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 1687, in add
    self.data = np.append(self.data, np.atleast_2d(coord), axis=0)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 527, in data
    self.selected_data = set(np.arange(cur_npoints, len(data)))
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 1295, in selected_data
    self.current_properties = properties
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/layers/points/points.py", line 657, in current_properties
    self.events.current_properties()
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/utils/events/event.py", line 510, in __call__
    self._invoke_callback(cb, event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/utils/events/event.py", line 527, in _invoke_callback
    _handle_exception(
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napari/utils/events/event.py", line 525, in _invoke_callback
    cb(event)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napping/napping.py", line 588, in on_points_layer_current_properties_changed
    self._controller._handle_control_points_changed()
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/napping/napping.py", line 440, in _handle_control_points_changed
    self._current_transformed_coords.to_csv(self.current_transformed_coords_dest_file_path, index=False)
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/pandas/core/generic.py", line 3386, in to_csv
    return DataFrameRenderer(formatter).to_csv(
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/pandas/io/formats/format.py", line 1083, in to_csv
    csv_formatter.save()
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/pandas/io/formats/csvs.py", line 228, in save
    with get_handle(
  File "/Users/immucan/opt/anaconda3/envs/napping/lib/python3.9/site-packages/pandas/io/common.py", line 642, in get_handle
    handle = open(
PermissionError: [Errno 13] Permission denied: '/Volumes/immucan_volume/raw_data/Panel_1/Batch20201113/IF_regions/csv_coordinates_transformed/XYZ.csv'

I understand it's problematic working directly on a mounted volume but maybe there is a way to safeguard against this error?
Cheers,

Nils

Show transform residuals

Show transform residuals as a feedback to the user if something went wrong re the control points

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.