Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InteractiveSegmentation] Decouple progress bar & more #146

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

dboun
Copy link
Collaborator

@dboun dboun commented Mar 12, 2020

Fix #142 progress bar resetting

Fix #115 Remove QProgressBar from module

(Also includes PR #141 and PR #145 to avoid conflicts. Please review these two PRs first) (sorry for the big PR in general!)

Changelog:

  • ProgressBar and Qt Widgets in general are completely decoupled from the module
  • Results (ok, errorMessage, result) are returned to the plugin, and it's now the plugin that adds them to the data storage etc + displays the error QMessageBox(es)
  • Adding/removing Image nodes (and not LabelSetImage or helper obj etc) resets the progress bar if the algorithm is not running
  • Run button is disabled while the algorithm runs, and displays "Running...".
  • Fixed a bug introduced recently where InteractiveSegmentation would crash if there was an internal error, like i.e. only 1 label existed in the seeds, because it tried to copy the seeds labelset to the non-existent output segmentation

Comment on lines 47 to 50
void OnModuleFinished(bool ok, std::string errorMessage, mitk::LabelSetImage::Pointer result);

void OnModuleProgressUpdate(int progress);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some comments

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


void SetProgressBar(QProgressBar* progressBar);
void OnProgressUpdateInternalReceived(int progress);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between the 2 update methods?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of connecting the ProgressUpdate(int) signal, with the QProgressBar's setValue(int) slot, we connect it with OnProgressUpdateInternalReceived(int), which then emits the signal. This re-emitted signal gets connected with the progress bar in the plugin.

That intermediate stage happens because the initial ProgressUpdate(int) signal doesn't belong to the class captk::InteractiveSegmentation, but a class it uses, so we can't connect it directly.

@dboun dboun requested a review from ashishsingh18 March 13, 2020 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants