Page MenuHomePhabricator

14986.patch

14986.patch

diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleProgressWidget.cpp b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleProgressWidget.cpp
index 8387851..6bd4788 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleProgressWidget.cpp
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleProgressWidget.cpp
@@ -44,7 +44,6 @@ See LICENSE.txt or http://www.mitk.org for details.
#include <QmitkCommonFunctionality.h>
#include <QmitkCustomVariants.h>
#include "QmitkCmdLineModuleGui.h"
-#include "QmitkIOUtil.h"
//-----------------------------------------------------------------------------
QmitkCmdLineModuleProgressWidget::QmitkCmdLineModuleProgressWidget(QWidget *parent)
@@ -546,44 +545,18 @@ void QmitkCmdLineModuleProgressWidget::Run()
int pid = QCoreApplication::applicationPid();
int randomInt = qrand() % 1000000;
- QString fileNameBase = m_TemporaryDirectoryName + "/" + name + QString::number(pid) + "_" + QString::number(randomInt);
- QString fileName = "";
- bool writeSucess = false;
- foreach (QString extension, parameter.fileExtensions())
- {
- fileName = fileNameBase + "." + extension;
- try
- {
- if (mitk::IOUtil::SaveBaseData( image, fileName.toStdString() ))
- {
- writeSucess = true;
- break;
- }
- }
- catch(std::exception& e){}
- }
- if(!writeSucess)
- {
- fileName = fileNameBase + ".nii";
- try
- {
- if (mitk::IOUtil::SaveBaseData( image, fileName.toStdString() ))
- {
- writeSucess = true;
- break;
- }
- }
- catch(std::exception& e){}
- }
- if(!writeSucess)
- {
- QMessageBox::warning(this, "Saving temporary input file failed", QString("Unsupported file formats: ")+parameter.fileExtensionsAsString()+", .nii");
- return;
- }
- m_TemporaryFileNames.push_back(fileName);
- m_ModuleFrontEnd->setValue(parameterName, fileName);
-
- message = "Saved " + fileName;
+ QString fileName = m_TemporaryDirectoryName + "/" + name + QString::number(pid) + "_" + QString::number(randomInt) + ".nii";
+
+ message = "Saving " + fileName;
+ this->PublishMessage(message);
+
+ std::string tmpFN = CommonFunctionality::SaveImage(image, fileName.toStdString().c_str());
+ QString temporaryStorageFileName = QString::fromStdString(tmpFN);
+
+ m_TemporaryFileNames.push_back(temporaryStorageFileName);
+ m_ModuleFrontEnd->setValue(parameterName, temporaryStorageFileName);
+
+ message = "Saved " + temporaryStorageFileName;
this->PublishMessage(message);
} // end if image
} // end if node
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.cpp b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.cpp
index 39442bd..923455d 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.cpp
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.cpp
@@ -16,7 +16,6 @@ See LICENSE.txt or http://www.mitk.org for details.
#include "QmitkUiLoader.h"
#include "QmitkDataStorageComboBoxWithSelectNone.h"
#include "mitkNodePredicateDataType.h"
-#include "mitkNodePredicateOr.h"
//-----------------------------------------------------------------------------
QmitkUiLoader::QmitkUiLoader(const mitk::DataStorage* dataStorage, QObject *parent)
@@ -52,7 +51,7 @@ QWidget* QmitkUiLoader::createWidget(const QString& className, QWidget* parent,
QmitkDataStorageComboBoxWithSelectNone* comboBox = new QmitkDataStorageComboBoxWithSelectNone(parent);
comboBox->setObjectName(name);
comboBox->SetAutoSelectNewItems(false);
- comboBox->SetPredicate(mitk::TNodePredicateDataType< mitk::Image >::New());
+ comboBox->SetPredicate(mitk::NodePredicateDataType::New("Image"));
comboBox->SetDataStorage(const_cast<mitk::DataStorage*>(m_DataStorage));
comboBox->setCurrentIndex(0);
widget = comboBox;

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
951

Event Timeline