Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • M MAPHIS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 49
    • Issues 49
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Radoslav Mráz
  • MAPHIS
  • Issues
  • #238
Closed
Open
Issue created Mar 30, 2023 by Karel Štěpka@xstepkaDeveloper

Brush stroke falling completely outside constraint-allowed area causes a crash

  1. Run in debug mode.
  2. Open a segmented photo.
  3. Select "Brush" tool.
  4. Choose the "Abdomen" label from the tree.
  5. Click "Set constraint" next to Abdomen.
  6. Try to draw a brush stroke that is completely inside the darkened part of the photo (e.g., outside the specimen or completely inside thorax). When the mouse button is released, the program crashes:
Traceback (most recent call last):
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\maphis\layers\mouse_event_layer.py", line 67, in mouseReleaseEvent
    layer.mouse_release(event)
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\maphis\layers\label_layer.py", line 385, in mouse_release
    cmd, bbox = self.current_tool.left_release(None, event.pos().toPoint(),
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\maphis\tools\brush.py", line 146, in left_release
    return self.get_command(ctx.label_img), QRect() #CommandEntry(lab_changes, update_canvas=False), QRect()
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\maphis\tools\brush.py", line 162, in get_command
    top, left, bottom, right = np.min(yy), np.min(xx), np.max(yy), np.max(xx)
  File "<__array_function__ internals>", line 5, in amin
  File "C:\Users\Karel\miniconda3\envs\arth2\lib\site-packages\numpy\core\fromnumeric.py", line 2830, in amin
    return _wrapreduction(a, np.minimum, 'min', axis, None, out,
  File "C:\Users\Karel\miniconda3\envs\arth2\lib\site-packages\numpy\core\fromnumeric.py", line 87, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation minimum which has no identity

Process finished with exit code 1

(This happens even if the selected label is "nothing" and the brush stroke would involve only pixels that are already "nothing". Seems to happen only with the Brush tool.)

Assignee
Assign to
Time tracking