Skip to content

Commit f1c73af

Browse files
authored
Merge branch 'CemrgDevelopers:feature/plugin/atrialfibres' into feature/plugin/atrialfibres
2 parents 925f51d + 425ed79 commit f1c73af

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

CemrgApp/Modules/CemrgAppModule/src/CemrgCommonUtils.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,8 @@ QString CemrgCommonUtils::OpenCarpParamFileGenerator(QString dir, QString filena
715715
out << "parab_use_pt " << "= " << " 1" << "\n";
716716

717717
int ix = 0;
718-
if(zeroBoundaryName.isEmpty()){
718+
bool onlyOneStimulusCheck = zeroBoundaryName.isEmpty();
719+
if(onlyOneStimulusCheck){
719720
out << "num_stim " << "= " << " 1" << "\n";
720721

721722
} else {
@@ -728,6 +729,10 @@ QString CemrgCommonUtils::OpenCarpParamFileGenerator(QString dir, QString filena
728729
out << "stimulus["+ QString::number(ix)+"].stimtype " << "= " << " 2" << "\n";
729730
out << "stimulus["+ QString::number(ix)+"].duration " << "= " << " 1" << "\n";
730731
out << "stimulus["+ QString::number(ix)+"].strength " << "= " << " 1.0" << "\n";
732+
733+
if(onlyOneStimulusCheck){
734+
out << "stimulus["+ QString::number(ix)+"].vtx_fcn " << "= " << " 1" << "\n";
735+
}
731736
out << "stimulus["+ QString::number(ix)+"].vtx_file " << "= " << oneBoundaryName << "\n";
732737

733738
return path2file;

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ bool AtrialFibresView::UserSelectUacMesh(){
10741074
if(uacMeshName.isEmpty()){
10751075
QMessageBox::information(NULL, "Open Mesh File", "Open the CARP mesh file (pts ONLY)");
10761076
QString meshPath = QFileDialog::getOpenFileName(NULL, "Open the CARP mesh file (pts ONLY)",
1077-
StdStringPath().c_str(), QmitkIOUtil::GetFileOpenFilterString());
1077+
StdStringPath().c_str(), tr("CARP points file (*.pts)"));
10781078
QFileInfo fi(meshPath);
10791079

10801080
uacMeshName = fi.baseName();
@@ -2220,7 +2220,7 @@ bool AtrialFibresView::LoadSurfaceChecks(){
22202220
}
22212221

22222222
void AtrialFibresView::UserLoadSurface(){
2223-
QString newpath = QFileDialog::getOpenFileName(NULL, "Select the surface file to load!", directory.toStdString().c_str(), QmitkIOUtil::GetFileOpenFilterString());
2223+
QString newpath = QFileDialog::getOpenFileName(NULL, "Select the surface file to load!", directory.toStdString().c_str(), tr("Mesh (*.vtk)"));
22242224
SetTagNameFromPath(newpath);
22252225
CheckLoadedMeshQuality();
22262226
}
@@ -2303,9 +2303,13 @@ void AtrialFibresView::CheckLoadedMeshQuality(){
23032303
QString meshinput = prodPath + tagName + ".vtk";
23042304

23052305
MITK_INFO << "Safety check: converting file to polydata: ";
2306-
std::unique_ptr<CemrgCommandLine> cmd(new CemrgCommandLine());
2307-
cmd->SetUseDockerContainers(true);
2308-
meshinput = cmd->DockerConvertMeshFormat(directory, tagName, "vtk", tagName, "vtk_polydata", 1);
2306+
std::string msg = "Is [" + (tagName + ".vtk").toStdString() + "] a vtk polydata?";
2307+
int reply = Ask("Question", msg);
2308+
if(reply==QMessageBox::No){
2309+
std::unique_ptr<CemrgCommandLine> cmd(new CemrgCommandLine());
2310+
cmd->SetUseDockerContainers(true);
2311+
meshinput = cmd->DockerConvertMeshFormat(directory, tagName, "vtk", tagName, "vtk_polydata", 1);
2312+
}
23092313
MITK_INFO << "Safety check: finished";
23102314

23112315
mitk::Surface::Pointer surface = mitk::IOUtil::Load<mitk::Surface>(meshinput.toStdString());
@@ -2337,6 +2341,5 @@ void AtrialFibresView::CheckLoadedMeshQuality(){
23372341
QString nameExt = "connectivityTest_"+QString::number(ix)+".vtk";
23382342
mitk::IOUtil::Save(surface, (prodPath+nameExt).toStdString());
23392343
}
2340-
23412344
}
23422345
}

0 commit comments

Comments
 (0)