Error in TI tutorial
-
Hello! I am new to using Sim4Life and am currently working through the tutorial titled tutorial_TI_|X|025_head_model.ipynb. However, I encountered an error while running the code, specifically in the "Extract Surfaces" part. The error message states: "invalid input labeled."
Could you kindly assist me in resolving this issue? Thank you for your help. -
The error looks like something is wrong with the matplotlib package in your installation (the MPLBACKEND environment variable). Did you possibly install any python packages in Sim4Life's Python with 'pip'?
Can you run any other notebooks with matplotlib plots?
-
I didn’t install any Python packages in Sim4Life’s Python environment using 'pip.' I installed this software by selecting all components during setup.
I’m not sure if my computer’s GPU (NVIDIA GeForce MX250) influenced this process. However, I chose "install deprecated NVIDIA driver" when installed this software.
-
When I restart the software and only import IXI025-Guys-0852-T1.nii.gz, the auto-label function works correctly.
However, when I run tutorial_TI_|X|025_head_model.ipynb, the same error occurs again.
After the error occurs, if I only load IXI025-Guys-0852-T1.nii.gz and run the 'auto-label function' (head modeling in the Ribbon), the same error now appears at this step. The only way to resolve it is to restart the software and reload IXI025-Guys-0852-T1.nii.gz—then it works correctly again.
However, if I try to run the TI tutorial, the error persists even after restarting the software.
![0BB7M7UAW`1BYC63FR)U]26.png](/assets/uploads/files/1748234490112-b021ff28-75cd-48f4-a814-49a0e4042b11-0bb7m7uaw-96-1byc63fr-u-26.png)
-
When I restart the software and only import IXI025-Guys-0852-T1.nii.gz, the auto-label function works correctly.
However, when I run tutorial_TI_|X|025_head_model.ipynb, the same error occurs again.
After the error occurs, if I only load IXI025-Guys-0852-T1.nii.gz and run the 'auto-label function' (head modeling in the Ribbon), the same error now appears at this step. The only way to resolve it is to restart the software and reload IXI025-Guys-0852-T1.nii.gz—then it works correctly again.
However, if I try to run the TI tutorial, the error persists even after restarting the software.
![0BB7M7UAW`1BYC63FR)U]26.png](/assets/uploads/files/1748234490112-b021ff28-75cd-48f4-a814-49a0e4042b11-0bb7m7uaw-96-1byc63fr-u-26.png)
-
When I copy the file tutorial_TI_|X|025_head_model.ipynb into the CAD files folder of Sim4Life version 8.2.0.16876 and run it in this older version, most sections execute correctly, including the "Auto Label Tissues and Extract Surfaces" part. However, the script fails at the "Computing the Maximum Modulation Using the Masked Electric Fields" section with the following error:
AttributeError: module 's4l_v1.analysis.core' has no attribute 'MaxModAmpEvaluator'.
Could you please advise on how to resolve this issue? Thank you for your assistance. -
The error looks like something is wrong with the matplotlib package in your installation (the MPLBACKEND environment variable). Did you possibly install any python packages in Sim4Life's Python with 'pip'?
Can you run any other notebooks with matplotlib plots?
@bryn Hello, I am using a script to run TI simulations. I noticed that when I change the maximum grid step size for the electrodes and tissues from [2.0, 2.0, 2.0] to [3.125, 3.125, 3.125] in each simulation, the peak value of the calculated electric field (E-field) changes from 205 V/m to 445 V/m. Why does the grid step size affect the final calculated E-field value? Additionally, I found that changing the step size also significantly alters the Scale Factor used to normalize the results in each simulation. Here is the relevant code :
manual_grid_settings.MaxStep = numpy.array([3.125, 3.125, 3.125]), units.MilliMeters
manual_grid_settings.Resolution = numpy.array([1.0, 1.0, 1.0]), units.MilliMeter