MIC-DKFZ / MIC-DKFZ/nnInteractive

IndexError: tuple index out of range

Open
#7 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
493
Forks
59
PR merge metrics
No merged PRs in 30d

Description

Thanks for your great work. I just use it in napari, when i click "initialize" in napari-nnInteractive, I get this error:

Using Model nnInteractive_v1.0 at : C:\Users\st\.cache\huggingface\hub\models--nnInteractive--nnInteractive\snapshots\67d7990b9ff7d68bee63e30ca9d3c575f2b2add0\nnInteractive_v1.0
nnUNet_raw is not defined and nnU-Net can only be used on data for which preprocessed files are already present on your system. nnU-Net cannot be used for experiment planning and preprocessing like this. If this is not intended, please read documentation/setting_up_paths.md for information on how to set this up properly.
nnUNet_preprocessed is not defined and nnU-Net can not be used for preprocessing or training. If this is not intended, please read documentation/setting_up_paths.md for information on how to set this up.
nnUNet_results is not defined and nnU-Net cannot be used for training or inference. If this is not intended behavior, please read documentation/setting_up_paths.md for information on how to set this up.
WARNING: Cuda is not available. Using CPU instead. This will result in longer runtimes and additionally auto-zoom will be disabled for runtime reasons
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
File C:\st\WPy64-310111\python-3.10.11.amd64\lib\site-packages\napari_nninteractive\widget_main.py:100, in nnInteractiveWidget.on_init(self=<napari_nninteractive.widget_main.nnInteractiveWidget object>, *args=(False,), **kwargs={})
     96 self.session.set_image(_data, {"spacing": self.session_cfg["spacing"]})
     98 self.session.set_target_buffer(self._data_result)
     99 self._scribble_brush_size = self.session.preferred_scribble_thickness[
--> 100     self._viewer.dims.not_displayed[0]
        self._scribble_brush_size = 5
        self.session = <nnInteractive.inference.inference_session.nnInteractiveInferenceSession object at 0x00000232880A8340>
        self = <napari_nninteractive.widget_main.nnInteractiveWidget object at 0x00000232693EBE20>
        self.session.preferred_scribble_thickness = [2, 2, 2]
        self._viewer.dims = Dims(ndim=3, ndisplay=3, order=(0, 1, 2), axis_labels=('0', '1', '2'), rollable=(True, True, True), range=(RangeTuple(start=818.7000122070312, stop=1037.7000122070312, step=1.5), RangeTuple(start=-223.1591796875, stop=-61.1591796875, step=1.5), RangeTuple(start=-48.6591796875, stop=113.3408203125, step=1.5)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(928.2000122070312, -142.1591796875, 32.3408203125), last_used=0)
        self._viewer = Viewer(camera=Camera(center=(928.2000122070312, -142.1591796875, 32.3408203125), zoom=3.4629969418960242, angles=(0.0, 0.0, 90.00000000000001), perspective=0.0, mouse_pan=True, mouse_zoom=True), cursor=Cursor(position=(928.2000122070312, -138.5611575735831, -128.67055680406244), scaled=True, style=<CursorStyle.STANDARD: 'standard'>, size=15.0), dims=Dims(ndim=3, ndisplay=3, order=(0, 1, 2), axis_labels=('0', '1', '2'), rollable=(True, True, True), range=(RangeTuple(start=818.7000122070312, stop=1037.7000122070312, step=1.5), RangeTuple(start=-223.1591796875, stop=-61.1591796875, step=1.5), RangeTuple(start=-48.6591796875, stop=113.3408203125, step=1.5)), margin_left=(0.0, 0.0, 0.0), margin_right=(0.0, 0.0, 0.0), point=(928.2000122070312, -142.1591796875, 32.3408203125), last_used=0), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[<Image layer 'ct.nii' at 0x23277b7cb80>, <Labels layer 'nnInteractive - Label Layer' at 0x23279bd7dc0>], help='use <7> for transform, use <1> for activate the label eraser, use <2> for activate the paint brush, use <3> for activate the polygon tool, use <4> for activate the fill bucket, use <5> for pick mode', status='', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=False, mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[<function double_click_to_zoom at 0x000002326B56C5E0>], mouse_wheel_callbacks=[<function dims_scroll at 0x000002326B537BE0>], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, _keymap={<KeyBinding at 0x23288097ac0: Ctrl+Q>: <bound method BaseGUI._close of <napari_nninteractive.widget_main.nnInteractiveWidget object at 0x00000232693EBE20>>})
    101 ]
    102 # Set the prompt type to positive
    103 self.prompt_button._uncheck()

IndexError: tuple index out of range

The image is a nii.gz file.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at napari_nninteractive/widget_main.py line 100 and reproduce initialization with the reported 3D nii.gz image in napari. Inspect the viewer dimensions and the access to viewer.dims.not_displayed during the initialize action. Done means initialization no longer raises IndexError for this 3D image.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.