Skip to content

Commit

Permalink
replicated the necessary functions from UAC pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sagebei committed Sep 2, 2024
1 parent a62bc8e commit 26d4e98
Show file tree
Hide file tree
Showing 5 changed files with 286 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ void AtrialFibresClipperView::CreateQtPartControl(QWidget *parent) {

// Display correct buttons
automaticPipeline = AtrialFibresClipperView::isAutomatic;

iniPreSurf();

debugging = false;
SetAutomaticModeButtons(automaticPipeline);
SetManualModeButtons(!automaticPipeline);
Expand Down Expand Up @@ -168,7 +171,7 @@ void AtrialFibresClipperView::CreateQtPartControl(QWidget *parent) {
interactor->GetInteractorStyle()->AddObserver(vtkCommand::KeyPressEvent, callBack);

MITK_INFO << "Initialisation";
iniPreSurf();
// iniPreSurf();
if (surface.IsNotNull()) {
InitialisePickerObjects();
clipper = std::unique_ptr<CemrgAtriaClipper>(new CemrgAtriaClipper(directory, surface));
Expand Down Expand Up @@ -198,6 +201,8 @@ void AtrialFibresClipperView::OnSelectionChanged(

AtrialFibresClipperView::~AtrialFibresClipperView() {
inputs->deleteLater();
AtrialFibresClipperView::fileName = "";
AtrialFibresClipperView::directory = "";
}

void AtrialFibresClipperView::SetDirectoryFile(const QString directory, const QString fileName, const bool isAutomatic) {
Expand All @@ -207,8 +212,24 @@ void AtrialFibresClipperView::SetDirectoryFile(const QString directory, const QS
}

void AtrialFibresClipperView::iniPreSurf() {

//Find the selected node
if (AtrialFibresClipperView::directory.isEmpty() || AtrialFibresClipperView::fileName.isEmpty()) {

QMessageBox msgBox;
msgBox.setText("Identify PV or Mesh Preprocessing?");
QPushButton *identify = msgBox.addButton(QMessageBox::Ok);
identify->setText("Identify PV");
QPushButton *preprocessing = msgBox.addButton(QMessageBox::Ok);
preprocessing->setText("Mesh Preprocessing");

msgBox.exec();

if (msgBox.clickedButton() == identify)
automaticPipeline = false;
else if (msgBox.clickedButton() == preprocessing)
automaticPipeline = true;

QString fileNamePath = QFileDialog::getOpenFileName(NULL, "Open mesh file (segmentation.vtk)",
directory.toStdString().c_str(), QmitkIOUtil::GetFileOpenFilterString());
QFileInfo fi(fileNamePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class AtrialFibresClipperView : public QmitkAbstractView {
inline void SetDebug(bool b){debugging = b;};
inline void SetDebugOn(){SetDebug(true);};
inline void SetDebugOff(){SetDebug(false);};
inline void static output_directory(){MITK_INFO << "Hi: " << directory;};

protected slots:

Expand Down Expand Up @@ -139,6 +140,7 @@ protected slots:

static QString fileName;
static QString directory;

static bool isAutomatic;

bool automaticPipeline, debugging;
Expand Down
Loading

0 comments on commit 26d4e98

Please sign in to comment.