Unable to Automatically Execute Ultrasound Simulation from Saved Workspace

Hi,

When I load a saved workspace (.iws), the ultrasound simulation doesn’t automatically run. I tried adding 1 inside the simulation algorithm block, but then it throws an error saying the transducer spline isn’t defined.

I think the spline annotations (center and direction) are created after the simulation algorithm gets executed, so the simulation fails because the required inputs aren’t ready yet. (I also tried reordering the .iws file so that comes before , but it didn’t change anything)

In older versions of ImFusion, it seems there was no issue since the splines were defined directly inside the UltrasoundSimulationHybrid algorithm. For example: ImFusionHybridUSSimulator/USHybridSim_auto_generate_imgs_masks.iws at main · danivelikova/ImFusionHybridUSSimulator · GitHub

I also tried executing multiple iws files sequentially to define splines before, but I was not able to reference a data object that created from the previous script.

reproducing steps:

  1. Load a label map (vertebra.nii.gz)
  2. Ultrasound->Advanced->Hybrid Ultrasound Simulation
  3. Define center and direction splines
  4. Simulate Sweep
  5. Save workspace (ultrasound_simulation.iws) (log_ultrasound_simulation_before_saving.log)
  6. Load workspace ultrasound_simulation.iws (thats where it does not automatically execute simulation) (log_ultrasound_simulation_after_loading_script.log)
  7. add 1 to in the iws file (ultrasound_simulation2.iws)
  8. Load workspace (it gives error saying that: [SyntheticUltrasoundSweepAlgorithm] Transducer center spline is not defined yet.) (log_ultrasound_simulation2_after_loading_script.log)

Example files: ImFusion_Ultrasound_Simulation – Google Drive

Version:
[Base.Framework] Available Plugins: ImFusionAS, ImFusionCT, ImFusionDicom, ImFusionDicomGui, ImFusionImageMath, ImFusionLiveUS, ImFusionML, ImFusionPython, ImFusionReg, ImFusionSeg, ImFusionStream, ImFusionUS, ImFusionVision, TorchPlugin.
ImFusionLib Version 3.13.8 built on 2025-3-7.
ImFusion Suite for Academia - not for clinical use - Version 3.13.8
(C) 2012-2025 ImFusion GmbH, Munich, Germany

System Specs:
Python
[Base.Framework] Available Plugins: ImFusionAS, ImFusionCT, ImFusionDicom, ImFusionDicomGui, ImFusionImageMath, ImFusionLiveUS, ImFusionML, ImFusionPython, ImFusionReg, ImFusionSeg, ImFusionStream, ImFusionUS, ImFusionVision, TorchPlugin.
[GUI.MainWindowBase] OpenGL: 4.1 Metal - 89.4
[GUI.MainWindowBase] Vendor: Apple
[GUI.MainWindowBase] GPU: Apple M1
[GUI.MainWindowBase] Memory: 10.67 GB of 16 GB available

Hi Burak,

Thanks for the detailed description of the problem and the steps to reproduce it!
I was able to reproduce the problem and we have a fix for it in progress.
So this will be fixed with the 4.1 release that will arrive in a week or two.

For when you have that new version, may I suggest you start with the simulation parametrization from the demo workspaces? HybridSimulation Demo workspace
You can simply open the workspace and copy the configuration:

Hi Rüdiger,

Thanks for the update. I’m looking forward to the new release and will check the demo workspace.

I also have a question too, not directly connected to this one.
Is it possible to automate the following action within the workspace file?

Ultrasound Sweep (right click) → Ultrasound → Sweep Properties → Registration → Align to Main Axis

Since this isn’t count as an algorithm, saving the workspace seems to store only the result, not the method itself. Is there a way to include this operation as part of the pipeline?

Thanks again.