invesalius / invesalius3

3D medical imaging reconstruction software
https://invesalius.github.io/
GNU General Public License v2.0
629 stars 286 forks source link

Loading project doesn't work in main branch #710

Closed okahilak closed 7 months ago

okahilak commented 8 months ago

The commit with ID 05777ee1 seems to break loading project (reverting the commit resolves the issue). Here's the stacktrace when trying to load a project in main:

Traceback (most recent call last):
  File "C:\Users\mTMS\invesalius3\invesalius\gui\frame.py", line 459, in OnMenuClick
    self.ShowOpenProject()
  File "C:\Users\mTMS\invesalius3\invesalius\gui\frame.py", line 722, in ShowOpenProject
    Publisher.sendMessage('Show open project dialog')
  File "C:\Users\mTMS\invesalius3\invesalius\pubsub\pub.py", line 74, in sendMessage
    Publisher.sendMessage(topicName, **msgdata)
  File "C:\Python38\lib\site-packages\pubsub\core\publisher.py", line 216, in sendMessage
    topicObj.publish(**msgData)
  File "C:\Python38\lib\site-packages\pubsub\core\topicobj.py", line 452, in publish
    self.__sendMessage(msgData, topicObj, msgDataSubset)
  File "C:\Python38\lib\site-packages\pubsub\core\topicobj.py", line 482, in __sendMessage
    listener(data, self, allData)
  File "C:\Python38\lib\site-packages\pubsub\core\listener.py", line 237, in __call__
    cb(**kwargs)
  File "C:\Users\mTMS\invesalius3\invesalius\control.py", line 157, in OnShowDialogOpenProject
    self.ShowDialogOpenProject()
  File "C:\Users\mTMS\invesalius3\invesalius\control.py", line 258, in ShowDialogOpenProject
    self.CloseProject()
  File "C:\Users\mTMS\invesalius3\invesalius\control.py", line 401, in CloseProject
    Publisher.sendMessage('Stop navigation')
  File "C:\Users\mTMS\invesalius3\invesalius\pubsub\pub.py", line 74, in sendMessage
    Publisher.sendMessage(topicName, **msgdata)
  File "C:\Python38\lib\site-packages\pubsub\core\publisher.py", line 216, in sendMessage
    topicObj.publish(**msgData)
  File "C:\Python38\lib\site-packages\pubsub\core\topicobj.py", line 452, in publish
    self.__sendMessage(msgData, topicObj, msgDataSubset)
  File "C:\Python38\lib\site-packages\pubsub\core\topicobj.py", line 482, in __sendMessage
    listener(data, self, allData)
  File "C:\Python38\lib\site-packages\pubsub\core\listener.py", line 237, in __call__
    cb(**kwargs)
  File "C:\Users\mTMS\invesalius3\invesalius\gui\task_navigator.py", line 1505, in OnStopNavigation
    self.navigation.StopNavigation()
  File "C:\Users\mTMS\invesalius3\invesalius\navigation\navigation.py", line 428, in StopNavigation
    self.pedal_connector.remove_callback('navigation')
  File "C:\Users\mTMS\invesalius3\invesalius\net\pedal_connection.py", line 101, in remove_callback
    self.panel_callbacks[panel.GetId()].pop(name)
KeyError: 126
sotodela commented 8 months ago

Is this also related to the loaded markers giving an error about "Invalid fiducials" when recovering the state (screenshot below)? After loading the markers files again the navigation works

Screenshot from 2024-02-26 17-43-00 5/2c01fe95-64ad-4cf1-bea6-e2111152870e)