Crash on attempting profile fusion when there is no target (to which a median profile should be registered)
- Run in debug mode, open a project.
- Plugins/Profile fusion.
- Click the "x" to remove the (only) registration target TagChooser. The UI will now say only "Median of [hover to select tags] will be registered to median of [+]".
- Apply. Program crashes:
Traceback (most recent call last):
File "D:/work/arthropods/arthropoddescriber2repository/arthropod_describer_py/arthropod_describer/app.py", line 501, in execute_general_action_or_show_settings
self.execute_general_action(action)
File "D:/work/arthropods/arthropoddescriber2repository/arthropod_describer_py/arthropod_describer/app.py", line 510, in execute_general_action
action(self.state, self.action_context)
File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\plugins\profile_register\general\profile_registering.py", line 69, in __call__
self._execute(state, _)
File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\plugins\profile_register\general\profile_registering.py", line 121, in _execute
src_median, dst_median, aligned = self._register(src, dsts, state)
File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\plugins\profile_register\general\profile_registering.py", line 148, in _register
dst_median_profile = get_median_profile(np.array(dst_median_profiles))
File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\plugins\profile_register\general\profiles.py", line 214, in get_median_profile
reference_profile = profiles[order[0]]
IndexError: index 0 is out of bounds for axis 0 with size 0
Process finished with exit code 1
Either it should be impossible to delete the last remaining TagChooser of the target specification, or the calculation should be skipped if no target is specified.