sampsapursiainen / zeffiro_interface

Interface for using finite elements in inverse problems with complex domains
GNU General Public License v3.0
23 stars 15 forks source link

Empty electrodes set breaks visualization #225

Open mshavliuk opened 1 year ago

mshavliuk commented 1 year ago

Description

Steps to reproduce

I'm getting error if I check "Visible" checkbox of an empty electrode set and click "Visualize surfaces". The electrodes set was created automatically for a new project, even though the import_segmentation.zef did not have a type,sensors line.

  1. Create a new project without electrodes, by importing the segmentation without electrodes
  2. Click "visible" checkbox for an empty electrodes set in Segmentation tool
  3. Click "Visualize surface" in Mesh Visualization tool

The following error occur:

Brace indexing is not supported for variables of this type.

Error in zef_plot_meshes (line 531)
                    h_text = text(sensors(i,1),sensors(i,2),sensors(i,3),sensors_name{i});

Error in zef_visualize_surfaces (line 3)
zef_update_fig_details;zef_plot_meshes([]);

Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 427)
Error while evaluating Button PrivateButtonPushedFcn.

Interestingly, it doesn't happen when any of the clipping planes is enabled.

Expected behavior

  1. I would expect the empty electrodes set not to be created for no reason
  2. Whenever an empty set of electrodes is visible, it shouldn't break the program

Screenshots

https://github.com/sampsapursiainen/zeffiro_interface/assets/6589665/1e93ecef-918b-4556-b8a4-164e73fd5ff8

Context

Name Value
Version 0aa766441dd8ebc43c54c09f4f976c8a25a2007d
OS MacOS
Shell N/A