Skip to content

Commit d2df9c5

Browse files
committed
remove unused iter argument to ExecuteSurf
1 parent ba8542d commit d2df9c5

11 files changed

Lines changed: 55 additions & 92 deletions

File tree

CemrgApp/Modules/CemrgAppModule/include/CemrgCommandLine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class MITKCEMRGAPPMODULE_EXPORT CemrgCommandLine: public QObject {
4949
QDialog* GetDialog();
5050

5151
//Execute Plugin Specific Functions
52-
QString ExecuteSurf(QString dir, QString segPath, int iter = 1, float th = 0.5, int blur = 0, int smth = 10);
52+
QString ExecuteSurf(QString dir, QString segPath, float th = 0.5, int blur = 0, int smth = 10);
5353
QString ExecuteCreateCGALMesh(QString dir, QString outputName, QString paramsFullPath, QString segmentationName = "converted.inr");
5454
void ExecuteTracking(QString dir, QString imgTimes, QString param, QString output = "tsffd.dof");
5555
void ExecuteApplying(QString dir, QString inputMesh, double iniTime, QString dofin, int noFrames, int smooth);

CemrgApp/Modules/CemrgAppModule/src/CemrgCommandLine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ QDialog* CemrgCommandLine::GetDialog() {
9393
****************** Execute Plugin Specific Functions **********************
9494
***************************************************************************/
9595

96-
QString CemrgCommandLine::ExecuteSurf(QString dir, QString segPath, int iter, float thresh, int blur, int smooth) {
96+
QString CemrgCommandLine::ExecuteSurf(QString dir, QString segPath, float thresh, int blur, int smooth) {
9797
MITK_INFO << "[ATTENTION] SURFACE CREATION: Surface -> Smooth";
9898

9999
// Load input image into memory

CemrgApp/Modules/CemrgAppModule/test/CemrgCommandLineTest.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,14 @@ void TestCemrgCommandLine::cleanupTestCase() {
123123

124124
void TestCemrgCommandLine::ExecuteSurf_data() {
125125
QTest::addColumn<QString>("segPath");
126-
QTest::addColumn<int>("iterations");
127126
QTest::addColumn<float>("threshold");
128127
QTest::addColumn<int>("blur");
129128
QTest::addColumn<int>("smoothness");
130129
QTest::addColumn<QString>("result");
131130

132131
const array<tuple<QString, QString, int, float, int, int, QString>, 2> surfData { {
133-
{"sphere_initial.nii", 1, 0.5, 0, 10, "/surf_expected_1.vtk"},
134-
{"sphere_shifted.nii", 1, 0.5, 0, 10, "/surf_expected_2.vtk"},
132+
{"sphere_initial.nii", 0.5, 0, 10, "/surf_expected_1.vtk"},
133+
{"sphere_shifted.nii", 0.5, 0, 10, "/surf_expected_2.vtk"},
135134
} };
136135

137136
for (size_t i = 0; i < surfData.size(); i++)
@@ -140,13 +139,12 @@ void TestCemrgCommandLine::ExecuteSurf_data() {
140139

141140
void TestCemrgCommandLine::ExecuteSurf() {
142141
QFETCH(QString, segPath);
143-
QFETCH(int, iterations);
144142
QFETCH(float, threshold);
145143
QFETCH(int, blur);
146144
QFETCH(int, smoothness);
147145
QFETCH(QString, result);
148146

149-
QString surfOutput = cemrgCommandLine->ExecuteSurf(dataPath, segPath, iterations, threshold, blur, smoothness);
147+
QString surfOutput = cemrgCommandLine->ExecuteSurf(dataPath, segPath, threshold, blur, smoothness);
150148
QVERIFY2(EqualFiles(surfOutput, dataPath + result), "The function output is different from the expected output!");
151149
}
152150

CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ void AtrialFibresView::AutomaticAnalysis(){
472472
std::unique_ptr<CemrgCommandLine> cmd(new CemrgCommandLine());
473473
cmd->SetUseDockerContainers(true);
474474

475-
cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_iter, uiMesh_th, uiMesh_bl, uiMesh_smth);
475+
cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_th, uiMesh_bl, uiMesh_smth);
476476
atrium->ProjectTagsOnExistingSurface(tagAtriumAuto, directory, tagName+".vtk");
477477

478478
MITK_INFO << "[AUTOMATIC_PIPELINE] Add the mesh to storage";
@@ -673,7 +673,7 @@ void AtrialFibresView::IdentifyPV(){
673673
std::unique_ptr<CemrgCommandLine> cmd(new CemrgCommandLine());
674674
cmd->SetUseDockerContainers(true);
675675

676-
cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_iter, uiMesh_th, uiMesh_bl, uiMesh_smth);
676+
cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_th, uiMesh_bl, uiMesh_smth);
677677

678678
//Add the mesh to storage
679679
std::string meshName = segNode->GetName() + "-Mesh";
@@ -728,7 +728,7 @@ void AtrialFibresView::CreateLabelledMesh(){
728728
std::unique_ptr<CemrgCommandLine> cmd(new CemrgCommandLine());
729729
cmd->SetUseDockerContainers(true);
730730

731-
cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_iter, uiMesh_th, uiMesh_bl, uiMesh_smth);
731+
cmd->ExecuteSurf(directory, Path("prodClean.nii"), uiMesh_th, uiMesh_bl, uiMesh_smth);
732732
atrium->ProjectTagsOnExistingSurface(pveins, directory, tagName+".vtk");
733733

734734
MITK_INFO << "Add the mesh to storage";
@@ -1996,7 +1996,6 @@ bool AtrialFibresView::GetUserMeshingInputs(){
19961996

19971997
if(userHasSetMeshingParams){
19981998
QString msg = "The parameters have been set already, change them?\n";
1999-
msg += "close iter= " + QString::number(uiMesh_iter) + '\n';
20001999
msg += "threshold= " + QString::number(uiMesh_th) + '\n';
20012000
msg += "blur= " + QString::number(uiMesh_bl) + '\n';
20022001
msg += "smooth iter= " + QString::number(uiMesh_smth);
@@ -2017,19 +2016,17 @@ bool AtrialFibresView::GetUserMeshingInputs(){
20172016
//Act on dialog return code
20182017
if (dialogCode == QDialog::Accepted) {
20192018

2020-
bool ok1, ok2, ok3, ok4;
2019+
bool ok1, ok2, ok3;
20212020
uiMesh_th= m_UIMeshing.lineEdit_1->text().toDouble(&ok1);
20222021
uiMesh_bl= m_UIMeshing.lineEdit_2->text().toDouble(&ok2);
20232022
uiMesh_smth= m_UIMeshing.lineEdit_3->text().toDouble(&ok3);
2024-
uiMesh_iter= m_UIMeshing.lineEdit_4->text().toDouble(&ok4);
20252023

20262024
//Set default values
2027-
if (!ok1 || !ok2 || !ok3 || !ok4)
2025+
if (!ok1 || !ok2 || !ok3)
20282026
QMessageBox::warning(NULL, "Attention", "Reverting to default parameters!");
20292027
if (!ok1) uiMesh_th=0.5;
20302028
if (!ok2) uiMesh_bl=0.0;
20312029
if (!ok3) uiMesh_smth=10;
2032-
if (!ok4) uiMesh_iter=0;
20332030

20342031
inputs->deleteLater();
20352032
userInputAccepted=true;

CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ protected slots:
173173
bool automaticPipeline, analysisOnLge, resurfaceMesh, userHasSetMeshingParams;
174174

175175
// user-defined parameters
176-
double uiMesh_th, uiMesh_bl, uiMesh_smth, uiMesh_iter;
176+
double uiMesh_th, uiMesh_bl, uiMesh_smth;
177177
double uiRemesh_max, uiRemesh_avrg, uiRemesh_min, uiRemesh_surfcorr;
178178
bool uiRemesh_isscalar, uiRemesh_extractParts, uiRemesh_cleanmesh;
179179
int uiScar_minStep, uiScar_maxStep, uiScar_projectionMethod, uiScar_thresholdMethod, uiFormat_scale;

CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresViewUIMeshing.ui

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>222</width>
10-
<height>196</height>
10+
<height>160</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -19,13 +19,13 @@
1919
<property name="minimumSize">
2020
<size>
2121
<width>0</width>
22-
<height>196</height>
22+
<height>160</height>
2323
</size>
2424
</property>
2525
<property name="maximumSize">
2626
<size>
2727
<width>16777215</width>
28-
<height>196</height>
28+
<height>160</height>
2929
</size>
3030
</property>
3131
<property name="windowTitle">
@@ -45,13 +45,6 @@
4545
</property>
4646
</widget>
4747
</item>
48-
<item>
49-
<widget class="QLineEdit" name="lineEdit_4">
50-
<property name="placeholderText">
51-
<string>'Close' iterations (default=0)</string>
52-
</property>
53-
</widget>
54-
</item>
5548
<item>
5649
<widget class="QLineEdit" name="lineEdit_1">
5750
<property name="placeholderText">

CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -564,25 +564,23 @@ void MmcwView::CreateSurf() {
564564
//Act on dialog return code
565565
if (dialogCode == QDialog::Accepted) {
566566

567-
bool ok1, ok2, ok3, ok4;
568-
int iter = m_UIMeshing.lineEdit_1->text().toInt(&ok1);
569-
float th = m_UIMeshing.lineEdit_2->text().toFloat(&ok2);
570-
int blur = m_UIMeshing.lineEdit_3->text().toInt(&ok3);
571-
int smth = m_UIMeshing.lineEdit_4->text().toInt(&ok4);
567+
bool ok1, ok2, ok3;
568+
float th = m_UIMeshing.lineEdit_1->text().toFloat(&ok1);
569+
int blur = m_UIMeshing.lineEdit_2->text().toInt(&ok2);
570+
int smth = m_UIMeshing.lineEdit_3->text().toInt(&ok3);
572571

573572
//Set default values
574-
if (!ok1 || !ok2 || !ok3 || !ok4)
573+
if (!ok1 || !ok2 || !ok3)
575574
QMessageBox::warning(NULL, "Attention", "Reverting to default parameters!");
576-
if (!ok1) iter = 1;
577-
if (!ok2) th = 0.5;
578-
if (!ok3) blur = 0;
579-
if (!ok4) smth = 10;
575+
if (!ok1) th = 0.5;
576+
if (!ok2) blur = 0;
577+
if (!ok3) smth = 10;
580578
//_if
581579

582580
this->BusyCursorOn();
583581
mitk::ProgressBar::GetInstance()->AddStepsToDo(3);
584582
std::unique_ptr<CemrgCommandLine> cmd(new CemrgCommandLine());
585-
QString output = cmd->ExecuteSurf(directory, path, iter, th, blur, smth);
583+
QString output = cmd->ExecuteSurf(directory, path, th, blur, smth);
586584
QMessageBox::information(NULL, "Attention", "Command Line Operations Finished!");
587585
this->BusyCursorOff();
588586

CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwViewUIMeshing.ui

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>216</width>
10-
<height>196</height>
10+
<height>160</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -19,13 +19,13 @@
1919
<property name="minimumSize">
2020
<size>
2121
<width>0</width>
22-
<height>196</height>
22+
<height>160</height>
2323
</size>
2424
</property>
2525
<property name="maximumSize">
2626
<size>
2727
<width>16777215</width>
28-
<height>196</height>
28+
<height>160</height>
2929
</size>
3030
</property>
3131
<property name="windowTitle">
@@ -50,30 +50,20 @@
5050
<property name="text">
5151
<string/>
5252
</property>
53-
<property name="placeholderText">
54-
<string>Iteration (default = 1)</string>
55-
</property>
56-
</widget>
57-
</item>
58-
<item>
59-
<widget class="QLineEdit" name="lineEdit_2">
6053
<property name="placeholderText">
6154
<string>Threshold (default = 0.5)</string>
6255
</property>
6356
</widget>
6457
</item>
6558
<item>
66-
<widget class="QLineEdit" name="lineEdit_3">
59+
<widget class="QLineEdit" name="lineEdit_2">
6760
<property name="placeholderText">
6861
<string>Blur (default = 0)</string>
6962
</property>
7063
</widget>
7164
</item>
7265
<item>
73-
<widget class="QLineEdit" name="lineEdit_4">
74-
<property name="text">
75-
<string/>
76-
</property>
66+
<widget class="QLineEdit" name="lineEdit_3">
7767
<property name="placeholderText">
7868
<string>Smooth (default = 10)</string>
7969
</property>

CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperView.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -190,28 +190,27 @@ void AtrialScarClipperView::iniPreSurf() {
190190
//Act on dialog return code
191191
if (dialogCode == QDialog::Accepted) {
192192

193-
bool ok1, ok2, ok3, ok4;
194-
int iter = m_UIMeshing.lineEdit_1->text().toInt(&ok1);
195-
float th = m_UIMeshing.lineEdit_2->text().toFloat(&ok2);
196-
int blur = m_UIMeshing.lineEdit_3->text().toInt(&ok3);
197-
int smth = m_UIMeshing.lineEdit_4->text().toInt(&ok4);
193+
bool ok1, ok2, ok3;
194+
// TODO: iter parameter is no longer used; remove from dialog box
195+
float th = m_UIMeshing.lineEdit_1->text().toFloat(&ok1);
196+
int blur = m_UIMeshing.lineEdit_2->text().toInt(&ok2);
197+
int smth = m_UIMeshing.lineEdit_3->text().toInt(&ok3);
198198
float ds = 0.1;
199199

200200
//Set default values
201-
if (!ok1 || !ok2 || !ok3 || !ok4)
201+
if (!ok1 || !ok2 || !ok3)
202202
QMessageBox::warning(NULL, "Attention", "Reverting to default parameters!");
203-
if (!ok1) iter = 1;
204-
if (!ok2) th = 0.5;
205-
if (!ok3) blur = 0;
206-
if (!ok4) smth = 10;
203+
if (!ok1) th = 0.5;
204+
if (!ok2) blur = 0;
205+
if (!ok3) smth = 10;
207206
//_if
208207

209208
this->BusyCursorOn();
210209
path = directory + "/temp.nii";
211210
mitk::IOUtil::Save(image, path.toStdString());
212211
mitk::ProgressBar::GetInstance()->AddStepsToDo(3);
213212
std::unique_ptr<CemrgCommandLine> cmd(new CemrgCommandLine());
214-
QString output = cmd->ExecuteSurf(directory, path, iter, th, blur, smth);
213+
QString output = cmd->ExecuteSurf(directory, path, th, blur, smth);
215214
QMessageBox::information(NULL, "Attention", "Command Line Operations Finished!");
216215
this->BusyCursorOff();
217216

CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarView.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ void AtrialScarView::AutomaticAnalysis() {
540540
MITK_INFO << ("[...][3.1] Saved file: " + segCleanPath).toStdString();
541541

542542
MITK_INFO << "[AUTOMATIC_ANALYSIS][4] Vein clipping mesh";
543-
QString output1 = cmd->ExecuteSurf(direct, segCleanPath, 1, .5, 0, 10);
543+
QString output1 = cmd->ExecuteSurf(direct, segCleanPath, .5, 0, 10);
544544
mitk::Surface::Pointer shell = mitk::IOUtil::Load<mitk::Surface>(output1.toStdString());
545545
vtkSmartPointer<vtkDecimatePro> deci = vtkSmartPointer<vtkDecimatePro>::New();
546546
deci->SetInputData(shell->GetVtkPolyData());
@@ -662,7 +662,7 @@ void AtrialScarView::AutomaticAnalysis() {
662662
MITK_INFO << "[...][7.3] ClipVeinsImage finished .";
663663

664664
MITK_INFO << "[AUTOMATIC_ANALYSIS][8] Create a mesh from clipped segmentation of veins";
665-
QString output2 = cmd->ExecuteSurf(direct, (direct + "/PVeinsCroppedImage.nii"), 1, .5, 0, 10);
665+
QString output2 = cmd->ExecuteSurf(direct, (direct + "/PVeinsCroppedImage.nii"), .5, 0, 10);
666666
mitk::Surface::Pointer LAShell = mitk::IOUtil::Load<mitk::Surface>(output2.toStdString());
667667

668668
MITK_INFO << "[AUTOMATIC_ANALYSIS][9] Clip the mitral valve";
@@ -693,7 +693,7 @@ void AtrialScarView::AutomaticAnalysis() {
693693
mitk::IOUtil::Save(mitk::ImportItkImage(mvImage), (direct + "/prodMVI.nii").toStdString());
694694

695695
// Make vtk of prodMVI
696-
QString mviShellPath = cmd->ExecuteSurf(direct, "prodMVI.nii", 1, 0.5, 0, 10);
696+
QString mviShellPath = cmd->ExecuteSurf(direct, "prodMVI.nii", 0.5, 0, 10);
697697
// Implement code from command line tool
698698
mitk::Surface::Pointer ClipperSurface = mitk::IOUtil::Load<mitk::Surface>(mviShellPath.toStdString());
699699
vtkSmartPointer<vtkImplicitPolyDataDistance> implicitFn = vtkSmartPointer<vtkImplicitPolyDataDistance>::New();
@@ -1176,19 +1176,17 @@ void AtrialScarView::CreateSurf() {
11761176
//Act on dialog return code
11771177
if (dialogCode == QDialog::Accepted) {
11781178

1179-
bool ok1, ok2, ok3, ok4;
1180-
int iter = m_UIMeshing.lineEdit_1->text().toInt(&ok1);
1181-
float th = m_UIMeshing.lineEdit_2->text().toFloat(&ok2);
1182-
int blur = m_UIMeshing.lineEdit_3->text().toInt(&ok3);
1183-
int smth = m_UIMeshing.lineEdit_4->text().toInt(&ok4);
1179+
bool ok1, ok2, ok3;
1180+
float th = m_UIMeshing.lineEdit_1->text().toFloat(&ok1);
1181+
int blur = m_UIMeshing.lineEdit_2->text().toInt(&ok2);
1182+
int smth = m_UIMeshing.lineEdit_3->text().toInt(&ok3);
11841183

11851184
//Set default values
1186-
if (!ok1 || !ok2 || !ok3 || !ok4)
1185+
if (!ok1 || !ok2 || !ok3)
11871186
QMessageBox::warning(NULL, "Attention", "Reverting to default parameters!");
1188-
if (!ok1) iter = 1;
1189-
if (!ok2) th = 0.5;
1190-
if (!ok3) blur = 0;
1191-
if (!ok4) smth = 10;
1187+
if (!ok1) th = 0.5;
1188+
if (!ok2) blur = 0;
1189+
if (!ok3) smth = 10;
11921190
//_if
11931191

11941192
this->BusyCursorOn();
@@ -1197,7 +1195,7 @@ void AtrialScarView::CreateSurf() {
11971195
mitk::ProgressBar::GetInstance()->AddStepsToDo(3);
11981196
std::unique_ptr<CemrgCommandLine> cmd(new CemrgCommandLine());
11991197
cmd->SetUseDockerContainers(_useDockerInPlugin);
1200-
path = cmd->ExecuteSurf(directory, pathTemp, iter, th, blur, smth);
1198+
path = cmd->ExecuteSurf(directory, pathTemp, th, blur, smth);
12011199
QMessageBox::information(NULL, "Attention", "Command Line Operations Finished!");
12021200
this->BusyCursorOff();
12031201

0 commit comments

Comments
 (0)