diff --git a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/files.cmake b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/files.cmake index 23957c69ab..a236edc150 100644 --- a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/files.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/files.cmake @@ -1,62 +1,65 @@ SET(SRC_CPP_FILES QmitkDiffusionImagingAppApplication.cpp QmitkDiffusionImagingAppWorkbenchAdvisor.cpp ) SET(INTERNAL_CPP_FILES - QmitkDiffusionImagingAppApplicationPlugin.cpp + mitkPluginActivator.cpp QmitkDiffusionImagingAppIntroPart.cpp QmitkDiffusionImagingAppPerspective.cpp QmitkWelcomePerspective.cpp + QmitkReconstructionPerspective.cpp ) SET(UI_FILES src/internal/QmitkWelcomeScreenViewControls.ui ) SET(MOC_H_FILES src/internal/QmitkDiffusionImagingAppIntroPart.h - src/internal/QmitkDiffusionImagingAppApplicationPlugin.h + src/internal/mitkPluginActivator.h src/QmitkDiffusionImagingAppApplication.h src/internal/QmitkDiffusionImagingAppPerspective.h src/internal/QmitkWelcomePerspective.h + src/internal/QmitkReconstructionPerspective.h ) SET(CACHED_RESOURCE_FILES # list of resource files which can be used by the plug-in # system without loading the plug-ins shared library, # for example the icon used in the menu and tabs for the # plug-in views in the workbench plugin.xml resources/diffusionimaging.png + resources/preprocessing.png ) SET(QRC_FILES # uncomment the following line if you want to use Qt resources resources/welcome/QmitkWelcomeScreenView.qrc resources/org_mitk_gui_qt_diffusionimagingapp.qrc ) # SET(CPP_FILES) foreach(file ${SRC_CPP_FILES}) SET(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) SET(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) #----------- Qt Help Collection Project -------------# IF (BLUEBERRY_USE_QT_HELP) SET(_plugin_qhcp_input "${CMAKE_CURRENT_SOURCE_DIR}/documentation/MitkDiffusionImagingAppQtHelpCollectionProject.qhcp") SET(_plugin_qhcp_output "${PLUGIN_OUTPUT_DIR}/resources/MitkDiffusionImagingAppQtHelpCollection_${MBI_WC_REVISION_HASH}.qhc") ADD_CUSTOM_COMMAND(OUTPUT ${_plugin_qhcp_output} COMMAND ${QT_COLLECTIONGENERATOR_EXECUTABLE} ${_plugin_qhcp_input} -o ${_plugin_qhcp_output} DEPENDS ${_plugin_qhcp_input} ) SET(FILE_DEPENDENCIES ${_plugin_qhcp_output}) ENDIF() diff --git a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/plugin.xml b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/plugin.xml index b2210518fc..850a880468 100644 --- a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/plugin.xml +++ b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/plugin.xml @@ -1,25 +1,32 @@ - + - + - + + + + + diff --git a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp index e3c2bb0c71..b4abc3cc9e 100644 --- a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp +++ b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp @@ -1,112 +1,112 @@ /*========================================================================= - + Program: BlueBerry Platform Language: C++ Date: $Date: 2009-10-23 02:59:36 +0200 (Fri, 23 Oct 2009) $ Version: $Revision$ - + Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - + This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. - + =========================================================================*/ #include "QmitkDiffusionImagingAppWorkbenchAdvisor.h" -#include "internal/QmitkDiffusionImagingAppApplicationPlugin.h" +#include "internal/mitkPluginActivator.h" #include #include #include #include #include #include const std::string QmitkDiffusionImagingAppWorkbenchAdvisor::WELCOME_PERSPECTIVE_ID = "org.mitk.diffusionimagingapp.perspectives.welcome"; void QmitkDiffusionImagingAppWorkbenchAdvisor::Initialize(berry::IWorkbenchConfigurer::Pointer configurer) { berry::QtWorkbenchAdvisor::Initialize(configurer); configurer->SetSaveAndRestore(true); // TODO This should go into the products plugin_customization.ini file (when // the product and branding support is finished, see bug 2146). // This will not work anymore, if bug 2822 is fixed. berry::IPreferencesService::Pointer prefService = berry::Platform::GetServiceRegistry().GetServiceById(berry::IPreferencesService::ID); prefService->GetSystemPreferences()->Put(berry::WorkbenchPreferenceConstants::PREFERRED_SASH_LAYOUT, berry::WorkbenchPreferenceConstants::RIGHT); - QString collectionFile = QmitkDiffusionImagingAppApplicationPlugin::GetDefault()->GetQtHelpCollectionFile(); + QString collectionFile = mitkPluginActivator::GetDefault()->GetQtHelpCollectionFile(); if (!collectionFile.isEmpty()) { // berry::QtAssistantUtil::SetHelpCollectionFile(collectionFile); // berry::QtAssistantUtil::SetDefaultHelpUrl("qthelp://org.mitk.gui.qt.diffusionimagingapp/bundle/index.html"); typedef std::vector BundleContainer; BundleContainer bundles = berry::Platform::GetBundles(); berry::QtAssistantUtil::RegisterQCHFiles(bundles); } } berry::WorkbenchWindowAdvisor* QmitkDiffusionImagingAppWorkbenchAdvisor::CreateWorkbenchWindowAdvisor( berry::IWorkbenchWindowConfigurer::Pointer configurer) { std::vector perspExcludeList; perspExcludeList.push_back( std::string("org.mitk.diffusionimagingapp.perspectives.welcome") ); perspExcludeList.push_back( std::string("org.mitk.perspectives.diffusionimaginginternal") ); perspExcludeList.push_back( std::string("org.mitk.perspectives.publicdiffusionimaging") ); perspExcludeList.push_back( std::string("org.mitk.extapp.defaultperspective") ); perspExcludeList.push_back( std::string("org.mitk.coreapp.defaultperspective") ); std::vector viewExcludeList; viewExcludeList.push_back( std::string("org.mitk.views.partialvolumeanalysis") ); viewExcludeList.push_back( std::string("org.mitk.views.globalfibertracking") ); viewExcludeList.push_back( std::string("org.mitk.views.tractbasedspatialstatistics") ); viewExcludeList.push_back( std::string("org.mitk.views.fibertracking") ); viewExcludeList.push_back( std::string("org.mitk.views.ivim") ); viewExcludeList.push_back( std::string("org.mitk.views.qballreconstruction") ); viewExcludeList.push_back( std::string("org.mitk.views.diffusiondicomimport") ); viewExcludeList.push_back( std::string("org.mitk.views.diffusionpreprocessing") ); viewExcludeList.push_back( std::string("org.mitk.views.diffusionquantification") ); viewExcludeList.push_back( std::string("org.mitk.views.tensorreconstruction") ); viewExcludeList.push_back( std::string("org.mitk.views.perspectiveswitcher") ); viewExcludeList.push_back( std::string("org.mitk.views.basicimageprocessing") ); viewExcludeList.push_back( std::string("org.mitk.views.fiberbundleoperations") ); viewExcludeList.push_back( std::string("org.mitk.views.measurement") ); viewExcludeList.push_back( std::string("org.mitk.views.moviemaker") ); viewExcludeList.push_back( std::string("org.mitk.views.odfdetails") ); viewExcludeList.push_back( std::string("org.mitk.views.propertylistview") ); viewExcludeList.push_back( std::string("org.mitk.views.screenshotmaker") ); viewExcludeList.push_back( std::string("org.mitk.views.segmentation") ); viewExcludeList.push_back( std::string("org.mitk.views.imagestatistics") ); // viewExcludeList.push_back( std::string("org.mitk.views.controlvisualizationpropertiesview") ); viewExcludeList.push_back( std::string("org.mitk.views.volumevisualization") ); viewExcludeList.push_back( std::string("org.mitk.views.simplemeasurement") ); configurer->SetShowPerspectiveBar(false); configurer->SetInitialSize(berry::Point(1000,770)); QmitkExtWorkbenchWindowAdvisor* advisor = new QmitkExtWorkbenchWindowAdvisor(this, configurer); advisor->SetPerspectiveExcludeList(perspExcludeList); advisor->SetViewExcludeList(viewExcludeList); advisor->ShowViewToolbar(false); advisor->ShowVersionInfo(false); advisor->ShowMitkVersionInfo(false); advisor->SetProductName("MITK Diffusion Imaging App"); advisor->SetWindowIcon(":/org.mitk.gui.qt.diffusionimagingapp/app-icon.png"); return advisor; } std::string QmitkDiffusionImagingAppWorkbenchAdvisor::GetInitialWindowPerspectiveId() { return WELCOME_PERSPECTIVE_ID; } diff --git a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionImagingAppApplicationPlugin.cpp b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionImagingAppApplicationPlugin.cpp deleted file mode 100644 index 74fb68831a..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionImagingAppApplicationPlugin.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/*========================================================================= - - Program: BlueBerry Platform - Language: C++ - Date: $Date$ - Version: $Revision$ - - Copyright (c) German Cancer Research Center, Division of Medical and - Biological Informatics. All rights reserved. - See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - - =========================================================================*/ - -#include "QmitkDiffusionImagingAppApplicationPlugin.h" -#include -#include -#include - -#include "src/QmitkDiffusionImagingAppApplication.h" - -#include "src/internal/QmitkDiffusionImagingAppIntroPart.h" -#include "src/internal/QmitkDiffusionImagingAppPerspective.h" -#include "src/internal/QmitkWelcomePerspective.h" - -#include -#include - -QmitkDiffusionImagingAppApplicationPlugin* QmitkDiffusionImagingAppApplicationPlugin::inst = 0; - -QmitkDiffusionImagingAppApplicationPlugin::QmitkDiffusionImagingAppApplicationPlugin() - : pluginListener(0) -{ - inst = this; -} - -QmitkDiffusionImagingAppApplicationPlugin::~QmitkDiffusionImagingAppApplicationPlugin() -{ - delete pluginListener; -} - -QmitkDiffusionImagingAppApplicationPlugin* QmitkDiffusionImagingAppApplicationPlugin::GetDefault() -{ - return inst; -} - -void QmitkDiffusionImagingAppApplicationPlugin::start(ctkPluginContext* context) -{ - berry::AbstractUICTKPlugin::start(context); - - this->context = context; - - BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionImagingAppApplication, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionImagingAppIntroPart, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionImagingAppPerspective, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkWelcomePerspective, context) - -// QString collectionFile = GetQtHelpCollectionFile(); - -// berry::QtAssistantUtil::SetHelpCollectionFile(collectionFile); -// berry::QtAssistantUtil::SetDefaultHelpUrl("qthelp://org.mitk.gui.qt.diffusionimagingapp/bundle/index.html"); - - delete pluginListener; - pluginListener = new berry::QCHPluginListener(context); - context->connectPluginListener(pluginListener, SLOT(pluginChanged(ctkPluginEvent)), Qt::DirectConnection); - - // register all QCH files from all the currently installed plugins - pluginListener->processPlugins(); - - -} - -QString QmitkDiffusionImagingAppApplicationPlugin::GetQtHelpCollectionFile() const -{ - - if (!helpCollectionFile.isEmpty()) - { - return helpCollectionFile; - } - - QString collectionFilename; - QString na("n/a"); -// if (na != MITK_REVISION) -// collectionFilename = "MitkDiffusionImagingAppQtHelpCollection_" MITK_REVISION ".qhc"; -// else - collectionFilename = "MitkDiffusionImagingAppQtHelpCollection.qhc"; - - QFileInfo collectionFileInfo = context->getDataFile(collectionFilename); - QFileInfo pluginFileInfo = QFileInfo(QUrl(context->getPlugin()->getLocation()).toLocalFile()); - if (!collectionFileInfo.exists() || - pluginFileInfo.lastModified() > collectionFileInfo.lastModified()) - { - // extract the qhc file from the plug-in - QByteArray content = context->getPlugin()->getResource(collectionFilename); - if (content.isEmpty()) - { - BERRY_WARN << "Could not get plug-in resource: " << collectionFilename.toStdString(); - } - else - { - QFile file(collectionFileInfo.absoluteFilePath()); - file.open(QIODevice::WriteOnly); - file.write(content); - file.close(); - } - } - - if (QFile::exists(collectionFileInfo.absoluteFilePath())) - { - helpCollectionFile = collectionFileInfo.absoluteFilePath(); - } - - return helpCollectionFile; - -} - -Q_EXPORT_PLUGIN2(org_mitk_gui_qt_diffusionimagingapp, QmitkDiffusionImagingAppApplicationPlugin) - - diff --git a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionImagingAppApplicationPlugin.h b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionImagingAppApplicationPlugin.h deleted file mode 100644 index 22babe8d7e..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionImagingAppApplicationPlugin.h +++ /dev/null @@ -1,58 +0,0 @@ -/*========================================================================= - - Program: BlueBerry Platform - Language: C++ - Date: $Date$ - Version: $Revision$ - - Copyright (c) German Cancer Research Center, Division of Medical and - Biological Informatics. All rights reserved. - See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - - =========================================================================*/ - -#ifndef QMITKDIFFUSIONIMAGINGAPPAPPLICATIONPLUGIN_H_ -#define QMITKDIFFUSIONIMAGINGAPPAPPLICATIONPLUGIN_H_ - -#include -#include -#include - -#include - -class QmitkDiffusionImagingAppApplicationPlugin : - public QObject, public berry::AbstractUICTKPlugin -{ - Q_OBJECT - Q_INTERFACES(ctkPluginActivator) - -public: - - QmitkDiffusionImagingAppApplicationPlugin(); - ~QmitkDiffusionImagingAppApplicationPlugin(); - - static QmitkDiffusionImagingAppApplicationPlugin* GetDefault(); - - ctkPluginContext* GetPluginContext() const; - - void start(ctkPluginContext*); - - QString GetQtHelpCollectionFile() const; - - private: - - static QmitkDiffusionImagingAppApplicationPlugin* inst; - - ctkPluginContext* context; - berry::QCHPluginListener* pluginListener; - - mutable QString helpCollectionFile; - - -}; // QmitkDiffusionImagingAppApplicationPlugin - -#endif // QMITKDIFFUSIONIMAGINGAPPAPPLICATIONPLUGIN_H_ diff --git a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionImagingAppIntroPart.cpp b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionImagingAppIntroPart.cpp index e0c4985c6c..cfe1343e5a 100644 --- a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionImagingAppIntroPart.cpp +++ b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionImagingAppIntroPart.cpp @@ -1,294 +1,294 @@ /*========================================================================= Program: BlueBerry Platform Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - + This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. - + =========================================================================*/ #include "QmitkDiffusionImagingAppIntroPart.h" #include "mitkNodePredicateDataType.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef QT_WEBKIT #include -#include +#include #endif #include #include #include #include #include #include #include "QmitkStdMultiWidgetEditor.h" -#include "QmitkDiffusionImagingAppApplicationPlugin.h" +#include "mitkPluginActivator.h" #include "mitkDataStorageEditorInput.h" #include "mitkBaseDataIOFactory.h" #include "mitkSceneIO.h" #include "mitkProgressBar.h" #include "mitkDataNodeFactory.h" #include "mitkNodePredicateNot.h" #include "mitkNodePredicateProperty.h" QmitkDiffusionImagingAppIntroPart::QmitkDiffusionImagingAppIntroPart() : m_Controls(NULL) { - berry::IPreferences::Pointer workbenchPrefs = QmitkDiffusionImagingAppApplicationPlugin::GetDefault()->GetPreferencesService()->GetSystemPreferences(); + berry::IPreferences::Pointer workbenchPrefs = mitkPluginActivator::GetDefault()->GetPreferencesService()->GetSystemPreferences(); workbenchPrefs->PutBool(berry::WorkbenchPreferenceConstants::SHOW_INTRO, true); workbenchPrefs->Flush(); } QmitkDiffusionImagingAppIntroPart::~QmitkDiffusionImagingAppIntroPart() { // if the workbench is not closing (that means, welcome screen was closed explicitly), set "Show_intro" false if (!this->GetIntroSite()->GetPage()->GetWorkbenchWindow()->GetWorkbench()->IsClosing()) { - berry::IPreferences::Pointer workbenchPrefs = QmitkDiffusionImagingAppApplicationPlugin::GetDefault()->GetPreferencesService()->GetSystemPreferences(); + berry::IPreferences::Pointer workbenchPrefs = mitkPluginActivator::GetDefault()->GetPreferencesService()->GetSystemPreferences(); workbenchPrefs->PutBool(berry::WorkbenchPreferenceConstants::SHOW_INTRO, false); workbenchPrefs->Flush(); } else { - berry::IPreferences::Pointer workbenchPrefs = QmitkDiffusionImagingAppApplicationPlugin::GetDefault()->GetPreferencesService()->GetSystemPreferences(); + berry::IPreferences::Pointer workbenchPrefs = mitkPluginActivator::GetDefault()->GetPreferencesService()->GetSystemPreferences(); workbenchPrefs->PutBool(berry::WorkbenchPreferenceConstants::SHOW_INTRO, true); workbenchPrefs->Flush(); } // if workbench is not closing (Just welcome screen closing), open last used perspective if (this->GetIntroSite()->GetPage()->GetPerspective()->GetId() == "org.mitk.diffusionimagingapp.perspectives.welcome" && !this->GetIntroSite()->GetPage()->GetWorkbenchWindow()->GetWorkbench()->IsClosing()) { berry::IPerspectiveDescriptor::Pointer perspective = this->GetIntroSite()->GetWorkbenchWindow()->GetWorkbench()->GetPerspectiveRegistry()->FindPerspectiveWithId("org.mitk.diffusionimagingapp.perspectives.diffusionimagingapp"); if (perspective) { this->GetIntroSite()->GetPage()->SetPerspective(perspective); } } } void QmitkDiffusionImagingAppIntroPart::CreateQtPartControl(QWidget* parent) { if (!m_Controls) { // create GUI widgets m_Controls = new Ui::QmitkWelcomeScreenViewControls; m_Controls->setupUi(parent); #ifdef QT_WEBKIT - // create a QWebView as well as a QWebPage and QWebFrame within the QWebview + // create a QWebView as well as a QWebPage and QWebFrame within the QWebview m_view = new QWebView(parent); m_view->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); - + QUrl urlQtResource(QString("qrc:/org.mitk.gui.qt.welcomescreen/mitkdiffusionimagingappwelcomeview.html"), QUrl::TolerantMode ); m_view->load( urlQtResource ); // adds the webview as a widget parent->layout()->addWidget(m_view); this->CreateConnections(); #else parent->layout()->addWidget(new QLabel("

Please install Qt with the WebKit option to see cool pictures!

")); #endif } } #ifdef QT_WEBKIT void QmitkDiffusionImagingAppIntroPart::CreateConnections() { if ( m_Controls ) { connect( (QObject*)(m_view->page()), SIGNAL(linkClicked(const QUrl& )), this, SLOT(DelegateMeTo(const QUrl& )) ); } } void QmitkDiffusionImagingAppIntroPart::DelegateMeTo(const QUrl& showMeNext) { QString scheme = showMeNext.scheme(); QByteArray urlHostname = showMeNext.encodedHost(); QByteArray urlPath = showMeNext.encodedPath(); QByteArray dataset = showMeNext.encodedQueryItemValue("dataset"); QByteArray clear = showMeNext.encodedQueryItemValue("clear"); - if (scheme.isEmpty()) MITK_INFO << " empty scheme of the to be delegated link" ; + if (scheme.isEmpty()) MITK_INFO << " empty scheme of the to be delegated link" ; - // if the scheme is set to mitk, it is to be tested which action should be applied + // if the scheme is set to mitk, it is to be tested which action should be applied if (scheme.contains(QString("mitk")) ) { if(urlPath.isEmpty() ) MITK_INFO << " mitk path is empty " ; // searching for the perspective keyword within the host name if(urlHostname.contains(QByteArray("perspectives")) ) { // the simplified method removes every whitespace // ( whitespace means any character for which the standard C++ isspace() method returns true) urlPath = urlPath.simplified(); QString tmpPerspectiveId(urlPath.data()); tmpPerspectiveId.replace(QString("/"), QString("") ); std::string perspectiveId = tmpPerspectiveId.toStdString(); // is working fine as long as the perspective id is valid, if not the application crashes GetIntroSite()->GetWorkbenchWindow()->GetWorkbench()->ShowPerspective(perspectiveId, GetIntroSite()->GetWorkbenchWindow() ); mitk::DataStorageEditorInput::Pointer editorInput; editorInput = new mitk::DataStorageEditorInput(); berry::IEditorPart::Pointer editor = GetIntroSite()->GetPage()->OpenEditor(editorInput, QmitkStdMultiWidgetEditor::EDITOR_ID); QmitkStdMultiWidgetEditor::Pointer multiWidgetEditor; mitk::DataStorage::Pointer dataStorage; if (editor.Cast().IsNull()) { editorInput = new mitk::DataStorageEditorInput(); dataStorage = editorInput->GetDataStorageReference()->GetDataStorage(); } else { multiWidgetEditor = editor.Cast(); multiWidgetEditor->GetStdMultiWidget()->RequestUpdate(); dataStorage = multiWidgetEditor->GetEditorInput().Cast()->GetDataStorageReference()->GetDataStorage(); } bool dsmodified = false; QString *fileName = new QString(dataset.data()); if ( fileName->right(5) == ".mitk" ) { mitk::SceneIO::Pointer sceneIO = mitk::SceneIO::New(); bool clearDataStorageFirst(false); QString *sClear = new QString(clear.data()); if ( sClear->right(4) == "true" ) { clearDataStorageFirst = true; } mitk::ProgressBar::GetInstance()->AddStepsToDo(2); dataStorage = sceneIO->LoadScene( fileName->toLocal8Bit().constData(), dataStorage, clearDataStorageFirst ); dsmodified = true; mitk::ProgressBar::GetInstance()->Progress(2); } else { mitk::DataNodeFactory::Pointer nodeReader = mitk::DataNodeFactory::New(); try { nodeReader->SetFileName(fileName->toLocal8Bit().data()); nodeReader->Update(); for ( unsigned int i = 0 ; i < nodeReader->GetNumberOfOutputs( ); ++i ) { mitk::DataNode::Pointer node; node = nodeReader->GetOutput(i); if ( node->GetData() != NULL ) { dataStorage->Add(node); dsmodified = true; } } } catch(...) { MITK_INFO << "Could not open file!"; } } if(dataStorage.IsNotNull() && dsmodified) { // get all nodes that have not set "includeInBoundingBox" to false mitk::NodePredicateNot::Pointer pred = mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("includeInBoundingBox" , mitk::BoolProperty::New(false))); mitk::DataStorage::SetOfObjects::ConstPointer rs = dataStorage->GetSubset(pred); if(rs->Size() > 0) { // calculate bounding geometry of these nodes mitk::TimeSlicedGeometry::Pointer bounds = dataStorage->ComputeBoundingGeometry3D(rs); // initialize the views to the bounding geometry mitk::RenderingManager::GetInstance()->InitializeViews(bounds); } } } // searching for the load if(urlHostname.contains(QByteArray("perspectives")) ) { // the simplified method removes every whitespace // ( whitespace means any character for which the standard C++ isspace() method returns true) urlPath = urlPath.simplified(); QString tmpPerspectiveId(urlPath.data()); tmpPerspectiveId.replace(QString("/"), QString("") ); std::string perspectiveId = tmpPerspectiveId.toStdString(); // is working fine as long as the perspective id is valid, if not the application crashes GetIntroSite()->GetWorkbenchWindow()->GetWorkbench()->ShowPerspective(perspectiveId, GetIntroSite()->GetWorkbenchWindow() ); mitk::DataStorageEditorInput::Pointer editorInput; editorInput = new mitk::DataStorageEditorInput(); GetIntroSite()->GetPage()->OpenEditor(editorInput, QmitkStdMultiWidgetEditor::EDITOR_ID); } else { MITK_INFO << "Unkown mitk action keyword (see documentation for mitk links)" ; } } // if the scheme is set to http, by default no action is performed, if an external webpage needs to be // shown it should be implemented below else if (scheme.contains(QString("http")) ) { QDesktopServices::openUrl(showMeNext); // m_view->load( ) ; } else if(scheme.contains("qrc")) { m_view->load(showMeNext); } } #endif void QmitkDiffusionImagingAppIntroPart::StandbyStateChanged(bool standby) { } void QmitkDiffusionImagingAppIntroPart::SetFocus() { }