diff --git a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/files.cmake b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/files.cmake
index dda7e25677..a67526ef99 100644
--- a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/files.cmake
+++ b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/files.cmake
@@ -1,73 +1,76 @@
SET(SRC_CPP_FILES
QmitkDiffusionImagingAppApplication.cpp
QmitkDiffusionImagingAppWorkbenchAdvisor.cpp
)
SET(INTERNAL_CPP_FILES
mitkPluginActivator.cpp
QmitkDiffusionImagingAppIntroPart.cpp
QmitkDiffusionImagingAppPerspective.cpp
QmitkWelcomePerspective.cpp
QmitkReconstructionPerspective.cpp
QmitkTrackingPerspective.cpp
QmitkFileImportPerspective.cpp
QmitkQuantificationPerspective.cpp
+ QmitkVolumeVisualizationPerspective.cpp
)
SET(UI_FILES
src/internal/QmitkWelcomeScreenViewControls.ui
)
SET(MOC_H_FILES
src/internal/QmitkDiffusionImagingAppIntroPart.h
src/internal/mitkPluginActivator.h
src/QmitkDiffusionImagingAppApplication.h
src/internal/QmitkDiffusionImagingAppPerspective.h
src/internal/QmitkWelcomePerspective.h
src/internal/QmitkReconstructionPerspective.h
src/internal/QmitkTrackingPerspective.h
src/internal/QmitkFileImportPerspective.h
src/internal/QmitkQuantificationPerspective.h
+ src/internal/QmitkVolumeVisualizationPerspective.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/icon_dicom.xpm
resources/diffusionimaging.png
resources/preprocessing.png
resources/Measurement_48.png
+ resources/volvis.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 1b26e8b057..87b3f6e5d2 100644
--- a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/plugin.xml
+++ b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/plugin.xml
@@ -1,53 +1,60 @@
+
+
+
+
diff --git a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkVolumeVisualizationPerspective.cpp b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkVolumeVisualizationPerspective.cpp
new file mode 100644
index 0000000000..e46999940e
--- /dev/null
+++ b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkVolumeVisualizationPerspective.cpp
@@ -0,0 +1,35 @@
+/*=========================================================================
+
+ Program: BlueBerry Platform
+ Language: C++
+ Date: $Date: 2009-10-23 02:59:36 +0200 (Fr, 23 Okt 2009) $
+ Version: $Revision: 19652 $
+
+ 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 "QmitkVolumeVisualizationPerspective.h"
+
+void QmitkVolumeVisualizationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
+{
+ std::string editorArea = layout->GetEditorArea();
+
+ layout->AddStandaloneView("org.mitk.views.datamanager", false, berry::IPageLayout::LEFT, 0.3f, editorArea);
+
+ berry::IFolderLayout::Pointer left =
+ layout->CreateFolder("org.mitk.leftcontrols",
+ berry::IPageLayout::BOTTOM, 0.2f, "org.mitk.views.datamanager");
+
+ left->AddView("org.mitk.views.volumevisualization");
+
+
+ berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.volumevisualization");
+ lo->SetCloseable(false);
+}
diff --git a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkVolumeVisualizationPerspective.h b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkVolumeVisualizationPerspective.h
new file mode 100644
index 0000000000..a7e2c686c2
--- /dev/null
+++ b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkVolumeVisualizationPerspective.h
@@ -0,0 +1,42 @@
+/*=========================================================================
+
+ Program: BlueBerry Platform
+ Language: C++
+ Date: $Date: 2009-10-23 02:59:36 +0200 (Fr, 23 Okt 2009) $
+ Version: $Revision: 19652 $
+
+ 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 QmitkVolumeVisualizationPerspective_H_
+#define QmitkVolumeVisualizationPerspective_H_
+
+#include
+
+class QmitkVolumeVisualizationPerspective : public QObject, public berry::IPerspectiveFactory
+{
+ Q_OBJECT
+ Q_INTERFACES(berry::IPerspectiveFactory)
+
+public:
+
+ QmitkVolumeVisualizationPerspective() {}
+ QmitkVolumeVisualizationPerspective(const QmitkVolumeVisualizationPerspective& other)
+ {
+ Q_UNUSED(other)
+ throw std::runtime_error("Copy constructor not implemented");
+ }
+ ~QmitkVolumeVisualizationPerspective() {}
+
+ void CreateInitialLayout(berry::IPageLayout::Pointer layout);
+};
+
+#endif /* QmitkVolumeVisualizationPerspective_H_ */
diff --git a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/mitkPluginActivator.cpp b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/mitkPluginActivator.cpp
index 3cd1568e3d..091dde09a1 100644
--- a/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/mitkPluginActivator.cpp
+++ b/Modules/Bundles/org.mitk.gui.qt.diffusionimagingapp/src/internal/mitkPluginActivator.cpp
@@ -1,130 +1,132 @@
/*=========================================================================
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 "mitkPluginActivator.h"
#include
#include
#include
#include "src/QmitkDiffusionImagingAppApplication.h"
#include "QmitkDiffusionImagingAppIntroPart.h"
#include "QmitkDiffusionImagingAppPerspective.h"
#include "QmitkWelcomePerspective.h"
#include "QmitkReconstructionPerspective.h"
#include "QmitkTrackingPerspective.h"
#include "QmitkFileImportPerspective.h"
#include "QmitkQuantificationPerspective.h"
+#include "QmitkVolumeVisualizationPerspective.h"
#include
#include
mitkPluginActivator* mitkPluginActivator::inst = 0;
mitkPluginActivator::mitkPluginActivator()
: pluginListener(0)
{
inst = this;
}
mitkPluginActivator::~mitkPluginActivator()
{
delete pluginListener;
}
mitkPluginActivator* mitkPluginActivator::GetDefault()
{
return inst;
}
void mitkPluginActivator::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)
BERRY_REGISTER_EXTENSION_CLASS(QmitkFileImportPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkReconstructionPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkQuantificationPerspective, context)
+ BERRY_REGISTER_EXTENSION_CLASS(QmitkVolumeVisualizationPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkTrackingPerspective, 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 mitkPluginActivator::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, mitkPluginActivator)
diff --git a/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.cpp b/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.cpp
index d61ff2387c..67ab188aac 100755
--- a/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.cpp
+++ b/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.cpp
@@ -1,341 +1,344 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision: 15646 $
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 "QmitkVolumeVisualizationView.h"
#include
#include
#include
#include
//#include
#include
#include
#include
#include
#include
#include
#include "mitkHistogramGenerator.h"
#include "QmitkPiecewiseFunctionCanvas.h"
#include "QmitkColorTransferFunctionCanvas.h"
#include "mitkBaseRenderer.h"
#include "mitkGPUVolumeMapper3D.h"
#include "mitkVtkVolumeRenderingProperty.h"
#include
#include
+const std::string QmitkVolumeVisualizationView::VIEW_ID =
+"org.mitk.views.volumevisualization";
+
enum RenderMode
{
RM_CPU_COMPOSITE_RAYCAST = 0,
RM_CPU_MIP_RAYCAST = 1,
RM_GPU_COMPOSITE_SLICING = 2,
RM_GPU_COMPOSITE_RAYCAST = 3,
RM_GPU_MIP_RAYCAST = 4
};
QmitkVolumeVisualizationView::QmitkVolumeVisualizationView()
-: QmitkFunctionality(),
+: QmitkFunctionality(),
m_Controls(NULL)
{
}
QmitkVolumeVisualizationView::~QmitkVolumeVisualizationView()
{
}
void QmitkVolumeVisualizationView::CreateQtPartControl(QWidget* parent)
{
-
+
if (!m_Controls)
{
m_Controls = new Ui::QmitkVolumeVisualizationViewControls;
m_Controls->setupUi(parent);
m_Controls->m_TransferFunctionWidget->SetIntegerMode(true);
// Fill the tf presets in the generator widget
std::vector names;
mitk::TransferFunctionInitializer::GetPresetNames(names);
for (std::vector::const_iterator it = names.begin();
it != names.end(); ++it)
{
m_Controls->m_TransferFunctionGeneratorWidget->AddPreset(QString::fromStdString(*it));
}
m_Controls->m_RenderMode->addItem("CPU raycast");
m_Controls->m_RenderMode->addItem("CPU MIP raycast");
m_Controls->m_RenderMode->addItem("GPU slicing");
// Only with VTK 5.6 or above
#if ((VTK_MAJOR_VERSION > 5) || ((VTK_MAJOR_VERSION==5) && (VTK_MINOR_VERSION>=6) ))
m_Controls->m_RenderMode->addItem("GPU raycast");
m_Controls->m_RenderMode->addItem("GPU MIP raycast");
#endif
connect( m_Controls->m_EnableRenderingCB, SIGNAL( toggled(bool) ),this, SLOT( OnEnableRendering(bool) ));
connect( m_Controls->m_EnableLOD, SIGNAL( toggled(bool) ),this, SLOT( OnEnableLOD(bool) ));
connect( m_Controls->m_RenderMode, SIGNAL( activated(int) ),this, SLOT( OnRenderMode(int) ));
connect( m_Controls->m_TransferFunctionGeneratorWidget, SIGNAL( SignalUpdateCanvas( ) ), m_Controls->m_TransferFunctionWidget, SLOT( OnUpdateCanvas( ) ) );
connect( m_Controls->m_TransferFunctionGeneratorWidget, SIGNAL(SignalTransferFunctionModeChanged(int)), SLOT(OnMitkInternalPreset(int)));
m_Controls->m_EnableRenderingCB->setEnabled(false);
m_Controls->m_EnableLOD->setEnabled(false);
m_Controls->m_RenderMode->setEnabled(false);
m_Controls->m_TransferFunctionWidget->setEnabled(false);
m_Controls->m_TransferFunctionGeneratorWidget->setEnabled(false);
-
+
m_Controls->m_SelectedImageLabel->hide();
m_Controls->m_ErrorImageLabel->hide();
-
+
}
}
void QmitkVolumeVisualizationView::OnMitkInternalPreset( int mode )
{
if (m_SelectedNode.IsNull()) return;
mitk::DataNode::Pointer node(m_SelectedNode.GetPointer());
mitk::TransferFunctionProperty::Pointer transferFuncProp;
if (node->GetProperty(transferFuncProp, "TransferFunction"))
{
//first item is only information
if( --mode == -1 )
return;
// -- Creat new TransferFunction
mitk::TransferFunctionInitializer::Pointer tfInit = mitk::TransferFunctionInitializer::New(transferFuncProp->GetValue());
tfInit->SetTransferFunctionMode(mode);
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
m_Controls->m_TransferFunctionWidget->OnUpdateCanvas();
}
}
void QmitkVolumeVisualizationView::OnSelectionChanged( std::vector nodes )
-{
+{
bool weHadAnImageButItsNotThreeDeeOrFourDee = false;
mitk::DataNode::Pointer node;
for (std::vector::iterator iter = nodes.begin();
iter != nodes.end();
++iter)
{
mitk::DataNode::Pointer currentNode = *iter;
-
+
if( currentNode.IsNotNull() && dynamic_cast(currentNode->GetData()) )
{
if( dynamic_cast(currentNode->GetData())->GetDimension()>=3 )
{
if (node.IsNull())
{
node = currentNode;
}
}
else
{
weHadAnImageButItsNotThreeDeeOrFourDee = true;
- }
+ }
}
}
if( node.IsNotNull() )
{
m_Controls->m_NoSelectedImageLabel->hide();
m_Controls->m_ErrorImageLabel->hide();
m_Controls->m_SelectedImageLabel->show();
-
+
std::string infoText;
-
+
if (node->GetName().empty())
infoText = std::string("Selected Image: [currently selected image has no name]");
else
infoText = std::string("Selected Image: ") + node->GetName();
-
+
m_Controls->m_SelectedImageLabel->setText( QString( infoText.c_str() ) );
-
+
m_SelectedNode = node;
}
else
{
if(weHadAnImageButItsNotThreeDeeOrFourDee)
{
m_Controls->m_NoSelectedImageLabel->hide();
m_Controls->m_ErrorImageLabel->show();
std::string infoText;
infoText = std::string("only 3D or 4D images are supported");
- m_Controls->m_ErrorImageLabel->setText( QString( infoText.c_str() ) );
+ m_Controls->m_ErrorImageLabel->setText( QString( infoText.c_str() ) );
}
else
{
m_Controls->m_SelectedImageLabel->hide();
m_Controls->m_ErrorImageLabel->hide();
m_Controls->m_NoSelectedImageLabel->show();
}
-
+
m_SelectedNode = 0;
}
UpdateInterface();
}
void QmitkVolumeVisualizationView::UpdateInterface()
{
if(m_SelectedNode.IsNull())
{
// turnoff all
m_Controls->m_EnableRenderingCB->setChecked(false);
m_Controls->m_EnableRenderingCB->setEnabled(false);
m_Controls->m_EnableLOD->setChecked(false);
m_Controls->m_EnableLOD->setEnabled(false);
m_Controls->m_RenderMode->setCurrentIndex(0);
m_Controls->m_RenderMode->setEnabled(false);
m_Controls->m_TransferFunctionWidget->SetDataNode(0);
m_Controls->m_TransferFunctionWidget->setEnabled(false);
m_Controls->m_TransferFunctionGeneratorWidget->SetDataNode(0);
m_Controls->m_TransferFunctionGeneratorWidget->setEnabled(false);
return;
}
-
+
bool enabled = false;
-
+
m_SelectedNode->GetBoolProperty("volumerendering",enabled);
m_Controls->m_EnableRenderingCB->setEnabled(true);
m_Controls->m_EnableRenderingCB->setChecked(enabled);
if(!enabled)
{
// turnoff all except volumerendering checkbox
m_Controls->m_EnableLOD->setChecked(false);
m_Controls->m_EnableLOD->setEnabled(false);
m_Controls->m_RenderMode->setCurrentIndex(0);
m_Controls->m_RenderMode->setEnabled(false);
m_Controls->m_TransferFunctionWidget->SetDataNode(0);
m_Controls->m_TransferFunctionWidget->setEnabled(false);
m_Controls->m_TransferFunctionGeneratorWidget->SetDataNode(0);
m_Controls->m_TransferFunctionGeneratorWidget->setEnabled(false);
return;
}
// otherwise we can activate em all
enabled = false;
m_SelectedNode->GetBoolProperty("volumerendering.uselod",enabled);
m_Controls->m_EnableLOD->setEnabled(true);
m_Controls->m_EnableLOD->setChecked(enabled);
-
+
m_Controls->m_RenderMode->setEnabled(true);
-
+
// Determine Combo Box mode
{
bool usegpu=false;
bool useray=false;
bool usemip=false;
m_SelectedNode->GetBoolProperty("volumerendering.usegpu",usegpu);
// Only with VTK 5.6 or above
#if ((VTK_MAJOR_VERSION > 5) || ((VTK_MAJOR_VERSION==5) && (VTK_MINOR_VERSION>=6) ))
m_SelectedNode->GetBoolProperty("volumerendering.useray",useray);
#endif
m_SelectedNode->GetBoolProperty("volumerendering.usemip",usemip);
-
+
int mode = 0;
-
+
if(useray)
{
if(usemip)
mode=RM_GPU_MIP_RAYCAST;
else
mode=RM_GPU_COMPOSITE_RAYCAST;
}
else if(usegpu)
mode=RM_GPU_COMPOSITE_SLICING;
else
{
if(usemip)
mode=RM_CPU_MIP_RAYCAST;
else
mode=RM_CPU_COMPOSITE_RAYCAST;
}
-
+
m_Controls->m_RenderMode->setCurrentIndex(mode);
- }
-
+ }
+
m_Controls->m_TransferFunctionWidget->SetDataNode(m_SelectedNode);
m_Controls->m_TransferFunctionWidget->setEnabled(true);
m_Controls->m_TransferFunctionGeneratorWidget->SetDataNode(m_SelectedNode);
m_Controls->m_TransferFunctionGeneratorWidget->setEnabled(true);
}
-void QmitkVolumeVisualizationView::OnEnableRendering(bool state)
+void QmitkVolumeVisualizationView::OnEnableRendering(bool state)
{
if(m_SelectedNode.IsNull())
return;
m_SelectedNode->SetProperty("volumerendering",mitk::BoolProperty::New(state));
UpdateInterface();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
-void QmitkVolumeVisualizationView::OnEnableLOD(bool state)
+void QmitkVolumeVisualizationView::OnEnableLOD(bool state)
{
if(m_SelectedNode.IsNull())
return;
m_SelectedNode->SetProperty("volumerendering.uselod",mitk::BoolProperty::New(state));
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
-void QmitkVolumeVisualizationView::OnRenderMode(int mode)
+void QmitkVolumeVisualizationView::OnRenderMode(int mode)
{
if(m_SelectedNode.IsNull())
return;
bool usegpu=mode==RM_GPU_COMPOSITE_SLICING;
// Only with VTK 5.6 or above
#if ((VTK_MAJOR_VERSION > 5) || ((VTK_MAJOR_VERSION==5) && (VTK_MINOR_VERSION>=6) ))
bool useray=(mode==RM_GPU_COMPOSITE_RAYCAST)||(mode==RM_GPU_MIP_RAYCAST);
#endif
bool usemip=(mode==RM_GPU_MIP_RAYCAST)||(mode==RM_CPU_MIP_RAYCAST);
-
+
m_SelectedNode->SetProperty("volumerendering.usegpu",mitk::BoolProperty::New(usegpu));
// Only with VTK 5.6 or above
#if ((VTK_MAJOR_VERSION > 5) || ((VTK_MAJOR_VERSION==5) && (VTK_MINOR_VERSION>=6) ))
m_SelectedNode->SetProperty("volumerendering.useray",mitk::BoolProperty::New(useray));
#endif
m_SelectedNode->SetProperty("volumerendering.usemip",mitk::BoolProperty::New(usemip));
-
+
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkVolumeVisualizationView::SetFocus()
{
}
diff --git a/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h b/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h
index cd011c3c27..6de9dd9ea6 100755
--- a/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h
+++ b/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h
@@ -1,87 +1,89 @@
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date$
Version: $Revision: 15646 $
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 QMITKVOLUMEVISUALIZATIONVIEW_H_
#define QMITKVOLUMEVISUALIZATIONVIEW_H_
#include
#include
#include
#include
#include
#include "mitkDataStorage.h"
#include
#include
#include
#include "ui_QmitkVolumeVisualizationViewControls.h"
/**
* \ingroup org_mitk_gui_qt_volumevisualization_internal
*/
class QmitkVolumeVisualizationView : public QmitkFunctionality
{
Q_OBJECT
public:
void SetFocus();
QmitkVolumeVisualizationView();
virtual ~QmitkVolumeVisualizationView();
virtual void CreateQtPartControl(QWidget *parent);
-
+
///
/// Invoked when the DataManager selection changed
///
virtual void OnSelectionChanged( std::vector nodes );
+ static const std::string VIEW_ID;
+
protected slots:
void OnMitkInternalPreset( int mode );
void OnEnableRendering( bool state );
void OnEnableLOD( bool state );
void OnRenderMode( int mode );
protected:
///
/// A selection listener for datatreenode events
///
berry::ISelectionListener::Pointer m_SelectionListener;
Ui::QmitkVolumeVisualizationViewControls* m_Controls;
private:
mitk::WeakPointer m_SelectedNode;
-
+
void UpdateInterface();
};
#endif /*QMITKVOLUMEVISUALIZATIONVIEW_H_*/