VirtualPhotonics / Vts.Gui.Wpf

WPF Application using the Vts library
Other
3 stars 0 forks source link

Monte Carlo panel: loading an infile with Cartesian coordinate detectors causes GUI to crash #14

Closed hayakawa16 closed 6 years ago

hayakawa16 commented 6 years ago

Trying to load infile infile_voxel_ROfXAndY_FluenceOfXAndYAndZ.txt causes an exception: An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll.

Note: in SL GUI same action: user can run simulation and it completes, no plots presented as it should.

hayakawa16 commented 6 years ago

The issue is not with the Cartesian coordinates, the issue is with the specification of an embedded voxel. In SimulationInputViewModel in the method UpdateTissueInputVM there is a switch statement based on the TissueType. There is no option for SingleVoxelTissueInput and default is an exception ArgumentOutOfRangeException. This is the same code as in the SL version however SL does not crash when exceptions are thrown(!).

hayakawa16 commented 6 years ago

Added VoxelRegionViewModel to handle infiles that specify tissue with embedded voxel.

Modified code so that now all downloadable infiles can be loaded. If the infile specifies R(rho) and/or Fluence(rho,z), either or both plots are displayed at the end of the simulation, as before. If the infile does not specify R(rho) or Fluence(rho,z) detectors, then a log message is output saying that no plots will be displayed at the end of the simulation. The user can save the results and all detectors specified in the infile will be saved. If the infile specifies the output of a database, then a log message tells the user that this output cannot be performed using the GUI and to use MCCL instead or load another infile.