pauldmccarthy / fsleyes

This is a mirror. Feel free to use the issue tracker. PRs welcome.
https://git.fmrib.ox.ac.uk/fsl/fsleyes/fsleyes/
Other
22 stars 11 forks source link

Edit mode works only in one plane #99

Closed valosekj closed 2 years ago

valosekj commented 2 years ago

In FSLeyes edit mode, I can edit binary mask (segmentation) only in one plane. In other plane, there is no action when I click by mouse. See video below:

https://user-images.githubusercontent.com/39456460/160337961-4287cda6-4098-4edf-8f4c-4b0c86e54784.mp4

I tried both "pencil" and "erase" tools. I also tried FSLeyes from two FSL versions (6.0.4, 6.0.5). The bug persists also when I create new empty mask.

I get following errors in terminal:

Traceback (most recent call last):
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/__init__.py", line 1298, in __onEvent
    self.__profile.handleEvent(ev)
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/__init__.py", line 771, in handleEvent
    handler(ev)
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/__init__.py", line 1138, in __onMouseMove
    self.__onMouseDrag(ev)
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/__init__.py", line 1179, in __onMouseDrag
    if handler(ev, canvas, mouseLoc, canvasLoc) is False:
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/__init__.py", line 962, in handlerWrapper
    retval = defHandler(*args, **kwargs)
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/orthoeditprofile.py", line 1554, in _deselModeLeftMouseDrag
    mode='desel')
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/orthoeditprofile.py", line 1470, in _selModeLeftMouseDrag
    from_=lastPos)
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/orthoeditprofile.py", line 1262, in __applySelection
    if add: block, offset = selection.selectLine(  *args)
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/editor/selection.py", line 577, in selectLine
    bias)
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/editor/selection.py", line 956, in selectLine
    offset = [int(min((xmin, minBox[:, 0].min()))),
TypeError: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/__init__.py", line 1298, in __onEvent
    self.__profile.handleEvent(ev)
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/__init__.py", line 771, in handleEvent
    handler(ev)
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/__init__.py", line 1119, in __onMouseUp
    if handler(ev, canvas, mouseLoc, canvasLoc) is False:
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/__init__.py", line 962, in handlerWrapper
    retval = defHandler(*args, **kwargs)
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/orthoeditprofile.py", line 1563, in _deselModeLeftMouseUp
    ev, canvas, mousePos, canvasPos, fillValue=self.eraseValue)
  File "/usr/local/fsl-6.0.4/fslpython/envs/fslpython/lib/python3.7/site-packages/fsleyes/profiles/orthoeditprofile.py", line 1513, in _selModeLeftMouseUp
    restrict      = [slice(o, o + s) for o, s in zip(off, new.shape)]
AttributeError: 'NoneType' object has no attribute 'shape'
pauldmccarthy commented 2 years ago

@valosekj Apologies for the delay. Can you check what version of FSLeyes you have installed? You can find out via the FSLeyes -> About menu option

valosekj commented 2 years ago

I can reproduce the bug in several FSLeyes versions on both MacOS and Debian.

MacOS 11.6.2

FSLeyes version: 1.0.13
FMRIB Centre, Oxford, UK
Paul McCarthy
paul.mccarthy@ndcn.ox.ac.uk
FSL version: 6.0.5
FSL directory: /usr/local/fsl
OpenGL version: 2.1
OpenGL compatibility: 2.1
OpenGL renderer: Apple M1

Debian 10.12

FSLeyes version: 0.34.2
FMRIB Centre, Oxford, UK
Paul McCarthy
paul.mccarthy@ndcn.ox.ac.uk
FSL version: 6.0.4
FSL directory: /usr/local/fsl
OpenGL version: 3.1
OpenGL compatibility: 2.1
OpenGL renderer: llvmpipe (LLVM 7.0, 128 bits)
pauldmccarthy commented 2 years ago

Are you able to try a more recent FSLeyes version? There is a good chance that this is a bug which has already been fixed.

pauldmccarthy commented 2 years ago

You can create a separate conda environment with a more recent FSLeyes version with something like this:

$FSLDIR/fslpython/bin/conda create -c conda-forge -p ~/new_fsleyes.env fsleyes

And then run ~/new_fsleyes.env/bin/fsleyes

valosekj commented 2 years ago

I have installed FLSeyes 1.3.3 via conda and edit mode now works!

Thank you very much for your help!