sampsapursiainen / zeffiro_interface

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

The surfaces visualisation gets broken after plotting graph #201

Open mshavliuk opened 1 year ago

mshavliuk commented 1 year ago

Description

The surfaces visualisation gets broken after plotting graph

Steps to reproduce

  1. Import multicompartment_head_project
  2. Generate FEM mesh
  3. Generate Lead Field via zef_tes_lead_field; script
  4. Click "plot graph"
  5. Click "visualize surfaces"
  6. see the error
Property assignment is not allowed when the object is empty.  Use
subscripted assignment to create an array element.

Error in zef_update_colorscale (line 25)
    h.ColorScale = 'linear';

Error in zef_set_sliders_plot (line 6)
evalin('base','zef_update_colorscale;');

Error in zef_plot_meshes (line 1228)
        zef_set_sliders_plot(1);

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.

Expected behavior

The figure tool shows a correct visualization for surface model, no errors occur.

Screenshots

https://user-images.githubusercontent.com/6589665/236665876-8f21e423-b347-45b1-9428-52f39d2ae33d.mp4

Context

Name Value
Version 2241fddd zef_nse_sigma: fix indentations with Matlab's smart indent tool
OS MacOS
Shell N/A
JoonasJL commented 1 year ago

I have partially solved this two years ago. The way to solve this permanently is to define functions for initializing 3D visualization and initializing 2D graphs that are called at the beginning of an appropriate type of visualization. Some of the handle variables for 3D visualization can be found in ZI's initialization scripts and others from zef_visualize_surfaces, for example, and zeffiro_interface/plugins/GMMClustering/v2/m/zef_plot_GMM_amplitudes.m lines 101-125 do what was once needed to draw 2D graphs.