From 53585300af5c1d8a841a9aaacd2eea940549f37e Mon Sep 17 00:00:00 2001 From: Jost Migenda Date: Wed, 10 Jul 2024 21:07:02 +0100 Subject: [PATCH] remove unused iter argument to ExecuteSurf GUI dialog boxes still need to be updated to remove this field --- .../Modules/CemrgAppModule/include/CemrgCommandLine.h | 2 +- CemrgApp/Modules/CemrgAppModule/src/CemrgCommandLine.cpp | 2 +- .../Modules/CemrgAppModule/test/CemrgCommandLineTest.cpp | 8 +++----- .../src/internal/AtrialFibresView.cpp | 7 ++++--- .../src/internal/AtrialFibresViewUIMeshing.ui | 2 +- .../kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp | 3 ++- .../src/internal/MmcwViewUIMeshing.ui | 2 +- .../src/internal/AtrialScarClipperView.cpp | 3 ++- .../kcl.cemrgapp.scar/src/internal/AtrialScarView.cpp | 9 +++++---- .../src/internal/AtrialScarViewUIMeshing.ui | 2 +- 10 files changed, 21 insertions(+), 19 deletions(-) diff --git a/CemrgApp/Modules/CemrgAppModule/include/CemrgCommandLine.h b/CemrgApp/Modules/CemrgAppModule/include/CemrgCommandLine.h index 29f31231..e2e75013 100644 --- a/CemrgApp/Modules/CemrgAppModule/include/CemrgCommandLine.h +++ b/CemrgApp/Modules/CemrgAppModule/include/CemrgCommandLine.h @@ -49,7 +49,7 @@ class MITKCEMRGAPPMODULE_EXPORT CemrgCommandLine: public QObject { QDialog* GetDialog(); //Execute Plugin Specific Functions - QString ExecuteSurf(QString dir, QString segPath, int iter = 1, float th = 0.5, int blur = 0, int smth = 10); + QString ExecuteSurf(QString dir, QString segPath, float th = 0.5, int blur = 0, int smth = 10); QString ExecuteCreateCGALMesh(QString dir, QString outputName, QString paramsFullPath, QString segmentationName = "converted.inr"); void ExecuteTracking(QString dir, QString imgTimes, QString param, QString output = "tsffd.dof"); void ExecuteApplying(QString dir, QString inputMesh, double iniTime, QString dofin, int noFrames, int smooth); diff --git a/CemrgApp/Modules/CemrgAppModule/src/CemrgCommandLine.cpp b/CemrgApp/Modules/CemrgAppModule/src/CemrgCommandLine.cpp index 17d2a645..52a58022 100644 --- a/CemrgApp/Modules/CemrgAppModule/src/CemrgCommandLine.cpp +++ b/CemrgApp/Modules/CemrgAppModule/src/CemrgCommandLine.cpp @@ -93,7 +93,7 @@ QDialog* CemrgCommandLine::GetDialog() { ****************** Execute Plugin Specific Functions ********************** ***************************************************************************/ -QString CemrgCommandLine::ExecuteSurf(QString dir, QString segPath, int iter, float thresh, int blur, int smooth) { +QString CemrgCommandLine::ExecuteSurf(QString dir, QString segPath, float thresh, int blur, int smooth) { MITK_INFO << "[ATTENTION] SURFACE CREATION: Surface -> Smooth"; // Load input image into memory diff --git a/CemrgApp/Modules/CemrgAppModule/test/CemrgCommandLineTest.cpp b/CemrgApp/Modules/CemrgAppModule/test/CemrgCommandLineTest.cpp index 9f6371bd..f923b71c 100644 --- a/CemrgApp/Modules/CemrgAppModule/test/CemrgCommandLineTest.cpp +++ b/CemrgApp/Modules/CemrgAppModule/test/CemrgCommandLineTest.cpp @@ -123,15 +123,14 @@ void TestCemrgCommandLine::cleanupTestCase() { void TestCemrgCommandLine::ExecuteSurf_data() { QTest::addColumn("segPath"); - QTest::addColumn("iterations"); QTest::addColumn("threshold"); QTest::addColumn("blur"); QTest::addColumn("smoothness"); QTest::addColumn("result"); const array, 2> surfData { { - {"sphere_initial.nii", 1, 0.5, 0, 10, "/surf_expected_1.vtk"}, - {"sphere_shifted.nii", 1, 0.5, 0, 10, "/surf_expected_2.vtk"}, + {"sphere_initial.nii", 0.5, 0, 10, "/surf_expected_1.vtk"}, + {"sphere_shifted.nii", 0.5, 0, 10, "/surf_expected_2.vtk"}, } }; for (size_t i = 0; i < surfData.size(); i++) @@ -140,13 +139,12 @@ void TestCemrgCommandLine::ExecuteSurf_data() { void TestCemrgCommandLine::ExecuteSurf() { QFETCH(QString, segPath); - QFETCH(int, iterations); QFETCH(float, threshold); QFETCH(int, blur); QFETCH(int, smoothness); QFETCH(QString, result); - QString surfOutput = cemrgCommandLine->ExecuteSurf(dataPath, segPath, iterations, threshold, blur, smoothness); + QString surfOutput = cemrgCommandLine->ExecuteSurf(dataPath, segPath, threshold, blur, smoothness); QVERIFY2(EqualFiles(surfOutput, dataPath + result), "The function output is different from the expected output!"); } diff --git a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp index a260bc1e..61071cec 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp @@ -472,7 +472,7 @@ void AtrialFibresView::AutomaticAnalysis(){ std::unique_ptr cmd(new CemrgCommandLine()); cmd->SetUseDockerContainers(true); - cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_iter, uiMesh_th, uiMesh_bl, uiMesh_smth); + cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_th, uiMesh_bl, uiMesh_smth); atrium->ProjectTagsOnExistingSurface(tagAtriumAuto, directory, tagName+".vtk"); MITK_INFO << "[AUTOMATIC_PIPELINE] Add the mesh to storage"; @@ -673,7 +673,7 @@ void AtrialFibresView::IdentifyPV(){ std::unique_ptr cmd(new CemrgCommandLine()); cmd->SetUseDockerContainers(true); - cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_iter, uiMesh_th, uiMesh_bl, uiMesh_smth); + cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_th, uiMesh_bl, uiMesh_smth); //Add the mesh to storage std::string meshName = segNode->GetName() + "-Mesh"; @@ -728,7 +728,7 @@ void AtrialFibresView::CreateLabelledMesh(){ std::unique_ptr cmd(new CemrgCommandLine()); cmd->SetUseDockerContainers(true); - cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_iter, uiMesh_th, uiMesh_bl, uiMesh_smth); + cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_th, uiMesh_bl, uiMesh_smth); atrium->ProjectTagsOnExistingSurface(pveins, directory, tagName+".vtk"); MITK_INFO << "Add the mesh to storage"; @@ -1992,6 +1992,7 @@ bool AtrialFibresView::GetUserAnalysisSelectorInputs(){ } bool AtrialFibresView::GetUserMeshingInputs(){ + // TODO: uiMesh_iter parameter is no longer used; remove from dialog box bool userInputAccepted=false; if(userHasSetMeshingParams){ diff --git a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresViewUIMeshing.ui b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresViewUIMeshing.ui index 182be0a7..930ed0a6 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresViewUIMeshing.ui +++ b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresViewUIMeshing.ui @@ -48,7 +48,7 @@ - 'Close' iterations (default=0) + 'Close' iterations (IGNORED) diff --git a/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp index abad5074..3fe7c1f5 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp @@ -565,6 +565,7 @@ void MmcwView::CreateSurf() { if (dialogCode == QDialog::Accepted) { bool ok1, ok2, ok3, ok4; + // TODO: iter parameter is no longer used; remove from dialog box int iter = m_UIMeshing.lineEdit_1->text().toInt(&ok1); float th = m_UIMeshing.lineEdit_2->text().toFloat(&ok2); int blur = m_UIMeshing.lineEdit_3->text().toInt(&ok3); @@ -582,7 +583,7 @@ void MmcwView::CreateSurf() { this->BusyCursorOn(); mitk::ProgressBar::GetInstance()->AddStepsToDo(3); std::unique_ptr cmd(new CemrgCommandLine()); - QString output = cmd->ExecuteSurf(directory, path, iter, th, blur, smth); + QString output = cmd->ExecuteSurf(directory, path, th, blur, smth); QMessageBox::information(NULL, "Attention", "Command Line Operations Finished!"); this->BusyCursorOff(); diff --git a/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwViewUIMeshing.ui b/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwViewUIMeshing.ui index fdc04be8..e26de607 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwViewUIMeshing.ui +++ b/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwViewUIMeshing.ui @@ -51,7 +51,7 @@ - Iteration (default = 1) + Iteration (IGNORED) diff --git a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperView.cpp index 232f451e..a43db5b5 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperView.cpp @@ -191,6 +191,7 @@ void AtrialScarClipperView::iniPreSurf() { if (dialogCode == QDialog::Accepted) { bool ok1, ok2, ok3, ok4; + // TODO: iter parameter is no longer used; remove from dialog box int iter = m_UIMeshing.lineEdit_1->text().toInt(&ok1); float th = m_UIMeshing.lineEdit_2->text().toFloat(&ok2); int blur = m_UIMeshing.lineEdit_3->text().toInt(&ok3); @@ -211,7 +212,7 @@ void AtrialScarClipperView::iniPreSurf() { mitk::IOUtil::Save(image, path.toStdString()); mitk::ProgressBar::GetInstance()->AddStepsToDo(3); std::unique_ptr cmd(new CemrgCommandLine()); - QString output = cmd->ExecuteSurf(directory, path, iter, th, blur, smth); + QString output = cmd->ExecuteSurf(directory, path, th, blur, smth); QMessageBox::information(NULL, "Attention", "Command Line Operations Finished!"); this->BusyCursorOff(); diff --git a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarView.cpp index f3a6e149..7da56897 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarView.cpp @@ -540,7 +540,7 @@ void AtrialScarView::AutomaticAnalysis() { MITK_INFO << ("[...][3.1] Saved file: " + segCleanPath).toStdString(); MITK_INFO << "[AUTOMATIC_ANALYSIS][4] Vein clipping mesh"; - QString output1 = cmd->ExecuteSurf(direct, segCleanPath, 1, .5, 0, 10); + QString output1 = cmd->ExecuteSurf(direct, segCleanPath, .5, 0, 10); mitk::Surface::Pointer shell = mitk::IOUtil::Load(output1.toStdString()); vtkSmartPointer deci = vtkSmartPointer::New(); deci->SetInputData(shell->GetVtkPolyData()); @@ -662,7 +662,7 @@ void AtrialScarView::AutomaticAnalysis() { MITK_INFO << "[...][7.3] ClipVeinsImage finished ."; MITK_INFO << "[AUTOMATIC_ANALYSIS][8] Create a mesh from clipped segmentation of veins"; - QString output2 = cmd->ExecuteSurf(direct, (direct + "/PVeinsCroppedImage.nii"), 1, .5, 0, 10); + QString output2 = cmd->ExecuteSurf(direct, (direct + "/PVeinsCroppedImage.nii"), .5, 0, 10); mitk::Surface::Pointer LAShell = mitk::IOUtil::Load(output2.toStdString()); MITK_INFO << "[AUTOMATIC_ANALYSIS][9] Clip the mitral valve"; @@ -693,7 +693,7 @@ void AtrialScarView::AutomaticAnalysis() { mitk::IOUtil::Save(mitk::ImportItkImage(mvImage), (direct + "/prodMVI.nii").toStdString()); // Make vtk of prodMVI - QString mviShellPath = cmd->ExecuteSurf(direct, "prodMVI.nii", 1, 0.5, 0, 10); + QString mviShellPath = cmd->ExecuteSurf(direct, "prodMVI.nii", 0.5, 0, 10); // Implement code from command line tool mitk::Surface::Pointer ClipperSurface = mitk::IOUtil::Load(mviShellPath.toStdString()); vtkSmartPointer implicitFn = vtkSmartPointer::New(); @@ -1177,6 +1177,7 @@ void AtrialScarView::CreateSurf() { if (dialogCode == QDialog::Accepted) { bool ok1, ok2, ok3, ok4; + // TODO: iter parameter is no longer used; remove from dialog box int iter = m_UIMeshing.lineEdit_1->text().toInt(&ok1); float th = m_UIMeshing.lineEdit_2->text().toFloat(&ok2); int blur = m_UIMeshing.lineEdit_3->text().toInt(&ok3); @@ -1197,7 +1198,7 @@ void AtrialScarView::CreateSurf() { mitk::ProgressBar::GetInstance()->AddStepsToDo(3); std::unique_ptr cmd(new CemrgCommandLine()); cmd->SetUseDockerContainers(_useDockerInPlugin); - path = cmd->ExecuteSurf(directory, pathTemp, iter, th, blur, smth); + path = cmd->ExecuteSurf(directory, pathTemp, th, blur, smth); QMessageBox::information(NULL, "Attention", "Command Line Operations Finished!"); this->BusyCursorOff(); diff --git a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarViewUIMeshing.ui b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarViewUIMeshing.ui index 2a867859..e69994b8 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarViewUIMeshing.ui +++ b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarViewUIMeshing.ui @@ -51,7 +51,7 @@ - Iteration (default = 1) + Iteration (IGNORED)