| 342 | } |
| 343 | |
| 344 | void mitk::nnInteractiveTool::ResetInteractions() |
| 345 | { |
| 346 | for (auto& [interactionType, interactor] : m_Impl->Interactors) |
| 347 | interactor->Reset(); |
| 348 | |
| 349 | m_Impl->InitialSeg = nullptr; |
| 350 | m_Impl->ClearLastInteraction(); |
| 351 | |
| 352 | if (this->IsSessionRunning()) |
| 353 | { |
| 354 | try |
| 355 | { |
| 356 | m_Impl->ResetInteractions(); |
| 357 | } |
| 358 | catch (const Exception& e) |
| 359 | { |
| 360 | // The local prompts are already cleared above. If the remote reset failed |
| 361 | // because the connection is gone, there is nothing left to reset on the |
| 362 | // server; the loss is surfaced on the next interaction, or by the heartbeat |
| 363 | // timer if one is running. |
| 364 | if (!this->IsRemoteConnectionError(Description(e))) |
| 365 | throw; |
| 366 | |
| 367 | MITK_WARN << "nnInteractive: could not reset interactions on the remote server (connection lost)."; |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | this->UpdatePreview(); |
| 372 | } |
| 373 | |
| 374 | bool mitk::nnInteractiveTool::HasInteractions() const |
| 375 | { |
no test coverage detected